Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1378766
| From | Ming Lei <tom.leiming@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v1 08/27] staging: lustre: avoid to use bio->bi_vcnt directly |
| Date | 2016-04-14 14:20 +0200 |
| Message-ID | <rnOpC-1sB-45@gated-at.bofh.it> (permalink) |
| References | <rnOfT-1oW-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
drivers/staging/lustre/lustre/llite/lloop.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/lustre/lustre/llite/lloop.c b/drivers/staging/lustre/lustre/llite/lloop.c
index f169c0d..c7bdc2f 100644
--- a/drivers/staging/lustre/lustre/llite/lloop.c
+++ b/drivers/staging/lustre/lustre/llite/lloop.c
@@ -302,19 +302,20 @@ static unsigned int loop_get_bio(struct lloop_device *lo, struct bio **req)
}
/* TODO: need to split the bio, too bad. */
- LASSERT(first->bi_vcnt <= LLOOP_MAX_SEGMENTS);
+ LASSERT(bio_pages(first) <= LLOOP_MAX_SEGMENTS);
rw = first->bi_rw;
bio = &lo->lo_bio;
while (*bio && (*bio)->bi_rw == rw) {
+ unsigned curr_cnt = bio_pages(*bio);
CDEBUG(D_INFO, "bio sector %llu size %u count %u vcnt%u\n",
(unsigned long long)(*bio)->bi_iter.bi_sector,
(*bio)->bi_iter.bi_size,
- page_count, (*bio)->bi_vcnt);
- if (page_count + (*bio)->bi_vcnt > LLOOP_MAX_SEGMENTS)
+ page_count, curr_cnt);
+ if (page_count + curr_cnt > LLOOP_MAX_SEGMENTS)
break;
- page_count += (*bio)->bi_vcnt;
+ page_count += curr_cnt;
count++;
bio = &(*bio)->bi_next;
}
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v1 00/27] block: cleanup direct access to .bi_vcnt & .bi_io_vec Ming Lei <tom.leiming@gmail.com> - 2016-04-14 14:20 +0200 [PATCH v1 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Ming Lei <tom.leiming@gmail.com> - 2016-04-14 14:20 +0200 [PATCH v1 06/27] block: floppy: use bio_set_vec_table() Ming Lei <tom.leiming@gmail.com> - 2016-04-14 14:20 +0200 [PATCH v1 05/27] block: pktcdvd: use bio_get_base_vec() to retrive bvec table Ming Lei <tom.leiming@gmail.com> - 2016-04-14 14:20 +0200 [PATCH v1 11/27] bcache: io.c: use bio_set_vec_table Ming Lei <tom.leiming@gmail.com> - 2016-04-14 14:20 +0200 [PATCH v1 01/27] block: bio: introduce 3 helpers for cleanup Ming Lei <tom.leiming@gmail.com> - 2016-04-14 14:20 +0200
csiph-web