* [PATCH 0/2] iov_iter: use bvec iterator to implement iterate_bvec()
@ 2015-10-10 15:20 Ming Lei
2015-10-10 15:20 ` [PATCH 1/2] block: mark 1st parameter of bvec_iter_advance as const Ming Lei
2015-10-10 15:20 ` [PATCH 2/2] iov_iter: use bvec iterator to implement iterate_bvec() Ming Lei
0 siblings, 2 replies; 6+ messages in thread
From: Ming Lei @ 2015-10-10 15:20 UTC (permalink / raw)
To: Jens Axboe, linux-kernel; +Cc: Christoph Hellwig, Andrew Morton, Alexander Viro
Hi,
This patch uses bvec's iterator to implement iterate_bvec() of iov_iter,
so we can avoid to invent new wheel for this job.
Thanks,
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] block: mark 1st parameter of bvec_iter_advance as const
2015-10-10 15:20 [PATCH 0/2] iov_iter: use bvec iterator to implement iterate_bvec() Ming Lei
@ 2015-10-10 15:20 ` Ming Lei
2015-10-10 15:20 ` [PATCH 2/2] iov_iter: use bvec iterator to implement iterate_bvec() Ming Lei
1 sibling, 0 replies; 6+ messages in thread
From: Ming Lei @ 2015-10-10 15:20 UTC (permalink / raw)
To: Jens Axboe, linux-kernel
Cc: Christoph Hellwig, Andrew Morton, Alexander Viro, Ming Lei
bvec_iter_advance() only writes the parameter of iterator,
so the base address of bvec can be marked as const safely.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
include/linux/bio.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index b9b6e04..3333684 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -193,7 +193,8 @@ static inline void *bio_data(struct bio *bio)
#define bio_for_each_segment_all(bvl, bio, i) \
for (i = 0, bvl = (bio)->bi_io_vec; i < (bio)->bi_vcnt; i++, bvl++)
-static inline void bvec_iter_advance(struct bio_vec *bv, struct bvec_iter *iter,
+static inline void bvec_iter_advance(const struct bio_vec *bv,
+ struct bvec_iter *iter,
unsigned bytes)
{
WARN_ONCE(bytes > iter->bi_size,
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] iov_iter: use bvec iterator to implement iterate_bvec()
2015-10-10 15:20 [PATCH 0/2] iov_iter: use bvec iterator to implement iterate_bvec() Ming Lei
2015-10-10 15:20 ` [PATCH 1/2] block: mark 1st parameter of bvec_iter_advance as const Ming Lei
@ 2015-10-10 15:20 ` Ming Lei
2015-10-10 15:33 ` kbuild test robot
2015-10-10 15:34 ` kbuild test robot
1 sibling, 2 replies; 6+ messages in thread
From: Ming Lei @ 2015-10-10 15:20 UTC (permalink / raw)
To: Jens Axboe, linux-kernel
Cc: Christoph Hellwig, Andrew Morton, Alexander Viro, Ming Lei
bvec has provided one iterator already, so not necessary
to invent a new wheel for this job.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
lib/iov_iter.c | 27 +++++++++------------------
1 file changed, 9 insertions(+), 18 deletions(-)
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 75232ad..e5cfc5c 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -3,6 +3,7 @@
#include <linux/pagemap.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
+#include <linux/bio.h>
#include <net/checksum.h>
#define iterate_iovec(i, n, __v, __p, skip, STEP) { \
@@ -57,28 +58,18 @@
}
#define iterate_bvec(i, n, __v, __p, skip, STEP) { \
- size_t wanted = n; \
+ struct bvec_iter __bi, __start; \
+ __start.bi_size = n; \
+ __start.bi_bvec_done = skip; \
+ __start.bi_idx = 0; \
__p = i->bvec; \
- __v.bv_len = min_t(size_t, n, __p->bv_len - skip); \
- if (likely(__v.bv_len)) { \
- __v.bv_page = __p->bv_page; \
- __v.bv_offset = __p->bv_offset + skip; \
+ for_each_bvec(__v, __p, __bi, __start) { \
(void)(STEP); \
- skip += __v.bv_len; \
- n -= __v.bv_len; \
} \
- while (unlikely(n)) { \
- __p++; \
- __v.bv_len = min_t(size_t, n, __p->bv_len); \
- if (unlikely(!__v.bv_len)) \
- continue; \
- __v.bv_page = __p->bv_page; \
- __v.bv_offset = __p->bv_offset; \
- (void)(STEP); \
+ if (!__bi.bi_idx) \
+ skip += __v.bv_len; \
+ else \
skip = __v.bv_len; \
- n -= __v.bv_len; \
- } \
- n = wanted; \
}
#define iterate_all_kinds(i, n, v, I, B, K) { \
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] iov_iter: use bvec iterator to implement iterate_bvec()
2015-10-10 15:20 ` [PATCH 2/2] iov_iter: use bvec iterator to implement iterate_bvec() Ming Lei
@ 2015-10-10 15:33 ` kbuild test robot
2015-10-10 15:48 ` Ming Lei
2015-10-10 15:34 ` kbuild test robot
1 sibling, 1 reply; 6+ messages in thread
From: kbuild test robot @ 2015-10-10 15:33 UTC (permalink / raw)
To: Ming Lei
Cc: kbuild-all, Jens Axboe, linux-kernel, Christoph Hellwig,
Andrew Morton, Alexander Viro, Ming Lei
[-- Attachment #1: Type: text/plain, Size: 9221 bytes --]
Hi Ming,
[auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, please ignore]
config: i386-randconfig-s1-201540 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All error/warnings (new ones prefixed by >>):
lib/iov_iter.c: In function 'copy_to_iter':
>> lib/iov_iter.c:61:19: error: storage size of '__bi' isn't known
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:61:25: error: storage size of '__start' isn't known
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:66:2: error: implicit declaration of function 'for_each_bvec' [-Werror=implicit-function-declaration]
for_each_bvec(__v, __p, __bi, __start) { \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:66:41: error: expected ';' before '{' token
for_each_bvec(__v, __p, __bi, __start) { \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:71:2: error: 'else' without a previous 'if'
else \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:61:25: warning: unused variable '__start' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:61:19: warning: unused variable '__bi' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c: In function 'copy_from_iter':
>> lib/iov_iter.c:61:19: error: storage size of '__bi' isn't known
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:61:25: error: storage size of '__start' isn't known
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:66:41: error: expected ';' before '{' token
for_each_bvec(__v, __p, __bi, __start) { \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:71:2: error: 'else' without a previous 'if'
else \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:61:25: warning: unused variable '__start' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:61:19: warning: unused variable '__bi' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c: In function 'copy_from_iter_nocache':
>> lib/iov_iter.c:61:19: error: storage size of '__bi' isn't known
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:428:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:61:25: error: storage size of '__start' isn't known
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:428:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:66:41: error: expected ';' before '{' token
for_each_bvec(__v, __p, __bi, __start) { \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:428:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:71:2: error: 'else' without a previous 'if'
else \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:428:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:61:25: warning: unused variable '__start' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:428:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
>> lib/iov_iter.c:61:19: warning: unused variable '__bi' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:428:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c: In function 'iov_iter_zero':
>> lib/iov_iter.c:61:19: error: storage size of '__bi' isn't known
struct bvec_iter __bi, __start; \
^
lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:474:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
vim +61 lib/iov_iter.c
55 n -= __v.iov_len; \
56 } \
57 n = wanted; \
58 }
59
60 #define iterate_bvec(i, n, __v, __p, skip, STEP) { \
> 61 struct bvec_iter __bi, __start; \
62 __start.bi_size = n; \
63 __start.bi_bvec_done = skip; \
64 __start.bi_idx = 0; \
65 __p = i->bvec; \
> 66 for_each_bvec(__v, __p, __bi, __start) { \
67 (void)(STEP); \
68 } \
69 if (!__bi.bi_idx) \
70 skip += __v.bv_len; \
> 71 else \
72 skip = __v.bv_len; \
73 }
74
75 #define iterate_all_kinds(i, n, v, I, B, K) { \
76 size_t skip = i->iov_offset; \
77 if (unlikely(i->type & ITER_BVEC)) { \
78 const struct bio_vec *bvec; \
79 struct bio_vec v; \
> 80 iterate_bvec(i, n, v, bvec, skip, (B)) \
81 } else if (unlikely(i->type & ITER_KVEC)) { \
82 const struct kvec *kvec; \
83 struct kvec v; \
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 17963 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] iov_iter: use bvec iterator to implement iterate_bvec()
2015-10-10 15:20 ` [PATCH 2/2] iov_iter: use bvec iterator to implement iterate_bvec() Ming Lei
2015-10-10 15:33 ` kbuild test robot
@ 2015-10-10 15:34 ` kbuild test robot
1 sibling, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2015-10-10 15:34 UTC (permalink / raw)
To: Ming Lei
Cc: kbuild-all, Jens Axboe, linux-kernel, Christoph Hellwig,
Andrew Morton, Alexander Viro, Ming Lei
[-- Attachment #1: Type: text/plain, Size: 9483 bytes --]
Hi Ming,
[auto build test WARNING on v4.3-rc4 -- if it's inappropriate base, please ignore]
config: x86_64-randconfig-x015-201540 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All warnings (new ones prefixed by >>):
lib/iov_iter.c: In function 'copy_to_iter':
lib/iov_iter.c:61:19: error: storage size of '__bi' isn't known
struct bvec_iter __bi, __start; \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
>> lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:61:25: error: storage size of '__start' isn't known
struct bvec_iter __bi, __start; \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
>> lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:66:2: error: implicit declaration of function 'for_each_bvec' [-Werror=implicit-function-declaration]
for_each_bvec(__v, __p, __bi, __start) { \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
>> lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:66:41: error: expected ';' before '{' token
for_each_bvec(__v, __p, __bi, __start) { \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
>> lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:71:2: error: 'else' without a previous 'if'
else \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
>> lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:61:25: warning: unused variable '__start' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
>> lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:61:19: warning: unused variable '__bi' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
>> lib/iov_iter.c:386:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c: In function 'copy_from_iter':
lib/iov_iter.c:61:19: error: storage size of '__bi' isn't known
struct bvec_iter __bi, __start; \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:61:25: error: storage size of '__start' isn't known
struct bvec_iter __bi, __start; \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:66:41: error: expected ';' before '{' token
for_each_bvec(__v, __p, __bi, __start) { \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:71:2: error: 'else' without a previous 'if'
else \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:61:25: warning: unused variable '__start' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c:61:19: warning: unused variable '__bi' [-Wunused-variable]
struct bvec_iter __bi, __start; \
^
>> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
iterate_bvec(i, n, v, bvec, skip, (B)) \
^
lib/iov_iter.c:407:2: note: in expansion of macro 'iterate_and_advance'
iterate_and_advance(i, bytes, v,
^
lib/iov_iter.c: In function 'copy_from_iter_nocache':
lib/iov_iter.c:61:19: error: storage size of '__bi' isn't known
struct bvec_iter __bi, __start; \
^
vim +/iterate_bvec +97 lib/iov_iter.c
a280455f mm/iov_iter.c Al Viro 2014-11-27 55 n -= __v.iov_len; \
a280455f mm/iov_iter.c Al Viro 2014-11-27 56 } \
a280455f mm/iov_iter.c Al Viro 2014-11-27 57 n = wanted; \
a280455f mm/iov_iter.c Al Viro 2014-11-27 58 }
a280455f mm/iov_iter.c Al Viro 2014-11-27 59
04a31165 mm/iov_iter.c Al Viro 2014-11-27 60 #define iterate_bvec(i, n, __v, __p, skip, STEP) { \
d8853dc1 lib/iov_iter.c Ming Lei 2015-10-10 @61 struct bvec_iter __bi, __start; \
d8853dc1 lib/iov_iter.c Ming Lei 2015-10-10 62 __start.bi_size = n; \
d8853dc1 lib/iov_iter.c Ming Lei 2015-10-10 63 __start.bi_bvec_done = skip; \
d8853dc1 lib/iov_iter.c Ming Lei 2015-10-10 64 __start.bi_idx = 0; \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 65 __p = i->bvec; \
d8853dc1 lib/iov_iter.c Ming Lei 2015-10-10 66 for_each_bvec(__v, __p, __bi, __start) { \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 67 (void)(STEP); \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 68 } \
d8853dc1 lib/iov_iter.c Ming Lei 2015-10-10 69 if (!__bi.bi_idx) \
d8853dc1 lib/iov_iter.c Ming Lei 2015-10-10 70 skip += __v.bv_len; \
d8853dc1 lib/iov_iter.c Ming Lei 2015-10-10 71 else \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 72 skip = __v.bv_len; \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 73 }
04a31165 mm/iov_iter.c Al Viro 2014-11-27 74
a280455f mm/iov_iter.c Al Viro 2014-11-27 75 #define iterate_all_kinds(i, n, v, I, B, K) { \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 76 size_t skip = i->iov_offset; \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 77 if (unlikely(i->type & ITER_BVEC)) { \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 78 const struct bio_vec *bvec; \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 79 struct bio_vec v; \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 80 iterate_bvec(i, n, v, bvec, skip, (B)) \
a280455f mm/iov_iter.c Al Viro 2014-11-27 81 } else if (unlikely(i->type & ITER_KVEC)) { \
a280455f mm/iov_iter.c Al Viro 2014-11-27 82 const struct kvec *kvec; \
a280455f mm/iov_iter.c Al Viro 2014-11-27 83 struct kvec v; \
a280455f mm/iov_iter.c Al Viro 2014-11-27 84 iterate_kvec(i, n, v, kvec, skip, (K)) \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 85 } else { \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 86 const struct iovec *iov; \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 87 struct iovec v; \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 88 iterate_iovec(i, n, v, iov, skip, (I)) \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 89 } \
04a31165 mm/iov_iter.c Al Viro 2014-11-27 90 }
04a31165 mm/iov_iter.c Al Viro 2014-11-27 91
a280455f mm/iov_iter.c Al Viro 2014-11-27 92 #define iterate_and_advance(i, n, v, I, B, K) { \
7ce2a91e mm/iov_iter.c Al Viro 2014-11-27 93 size_t skip = i->iov_offset; \
7ce2a91e mm/iov_iter.c Al Viro 2014-11-27 94 if (unlikely(i->type & ITER_BVEC)) { \
7ce2a91e mm/iov_iter.c Al Viro 2014-11-27 95 const struct bio_vec *bvec; \
7ce2a91e mm/iov_iter.c Al Viro 2014-11-27 96 struct bio_vec v; \
7ce2a91e mm/iov_iter.c Al Viro 2014-11-27 @97 iterate_bvec(i, n, v, bvec, skip, (B)) \
7ce2a91e mm/iov_iter.c Al Viro 2014-11-27 98 if (skip == bvec->bv_len) { \
7ce2a91e mm/iov_iter.c Al Viro 2014-11-27 99 bvec++; \
7ce2a91e mm/iov_iter.c Al Viro 2014-11-27 100 skip = 0; \
:::::: The code at line 97 was first introduced by commit
:::::: 7ce2a91e51288f308bfe5ea7e5743517c15c8e25 iov_iter.c: iterate_and_advance
:::::: TO: Al Viro <viro@zeniv.linux.org.uk>
:::::: CC: Al Viro <viro@zeniv.linux.org.uk>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 21344 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] iov_iter: use bvec iterator to implement iterate_bvec()
2015-10-10 15:33 ` kbuild test robot
@ 2015-10-10 15:48 ` Ming Lei
0 siblings, 0 replies; 6+ messages in thread
From: Ming Lei @ 2015-10-10 15:48 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, Jens Axboe, Linux Kernel Mailing List,
Christoph Hellwig, Andrew Morton, Alexander Viro
On Sat, Oct 10, 2015 at 11:33 PM, kbuild test robot <lkp@intel.com> wrote:
> Hi Ming,
>
> [auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, please ignore]
>
> config: i386-randconfig-s1-201540 (attached as .config)
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All error/warnings (new ones prefixed by >>):
>
> lib/iov_iter.c: In function 'copy_to_iter':
>>> lib/iov_iter.c:61:19: error: storage size of '__bi' isn't known
> struct bvec_iter __bi, __start; \
> ^
> lib/iov_iter.c:97:3: note: in expansion of macro 'iterate_bvec'
> iterate_bvec(i, n, v, bvec, skip, (B)) \
The warning is because CONFIG_BLOCK is disabled, maybe
bvec iterator helpers still need to include even though CONFIG_BLOCK
is disabled.
--
Ming Lei
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-10-10 15:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-10 15:20 [PATCH 0/2] iov_iter: use bvec iterator to implement iterate_bvec() Ming Lei
2015-10-10 15:20 ` [PATCH 1/2] block: mark 1st parameter of bvec_iter_advance as const Ming Lei
2015-10-10 15:20 ` [PATCH 2/2] iov_iter: use bvec iterator to implement iterate_bvec() Ming Lei
2015-10-10 15:33 ` kbuild test robot
2015-10-10 15:48 ` Ming Lei
2015-10-10 15:34 ` kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®