From: Ming Lei <tom.leiming@gmail.com> To: Jens Axboe <axboe@fb.com>, linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@infradead.org>, Ming Lei <tom.leiming@gmail.com>, Oleg Drokin <oleg.drokin@intel.com>, Andreas Dilger <andreas.dilger@intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Frank Zago <fzago@cray.com>, "John L. Hammond" <john.hammond@intel.com>, Mike Rapoport <mike.rapoport@gmail.com>, James Simmons <jsimmons@infradead.org>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Kent Overstreet <kent.overstreet@gmail.com>, Julia Lawall <Julia.Lawall@lip6.fr>, lustre-devel@lists.lustre.org (moderated list:STAGING - LUSTRE PARALLEL FILESYSTEM), devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) Subject: [PATCH v1 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Date: Thu, 14 Apr 2016 20:02:26 +0800 [thread overview] Message-ID: <1460635375-28282-9-git-send-email-tom.leiming@gmail.com> (raw) In-Reply-To: <1460635375-28282-1-git-send-email-tom.leiming@gmail.com> 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
WARNING: multiple messages have this Message-ID (diff)
From: Ming Lei <tom.leiming@gmail.com> To: Jens Axboe <axboe@fb.com>, linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig <hch@infradead.org>, Ming Lei <tom.leiming@gmail.com>, Oleg Drokin <oleg.drokin@intel.com>, Andreas Dilger <andreas.dilger@intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Frank Zago <fzago@cray.com>, "John L. Hammond" <john.hammond@intel.com>, Mike Rapoport <mike.rapoport@gmail.com>, James Simmons <jsimmons@infradead.org>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Kent Overstreet <kent.overstreet@gmail.com>, Julia Lawall <Julia.Lawall@lip6.fr>, "moderated list:STAGING - LUSTRE PARALLEL FILESYSTEM" <lustre-devel@lists.lustre.org>, "open list:STAGING SUBSYSTEM" <devel@driverdev.osuosl.org> Subject: [lustre-devel] [PATCH v1 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Date: Thu, 14 Apr 2016 20:02:26 +0800 [thread overview] Message-ID: <1460635375-28282-9-git-send-email-tom.leiming@gmail.com> (raw) In-Reply-To: <1460635375-28282-1-git-send-email-tom.leiming@gmail.com> 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
next prev parent reply other threads:[~2016-04-14 12:10 UTC|newest] Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-04-14 12:02 [PATCH v1 00/27] block: cleanup direct access to .bi_vcnt & .bi_io_vec Ming Lei 2016-04-14 12:02 ` [lustre-devel] " Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 01/27] block: bio: introduce 3 helpers for cleanup Ming Lei 2016-04-14 12:02 ` [PATCH v1 02/27] block: drbd: use bio_get_base_vec() to retrieve the 1st bvec Ming Lei 2016-04-14 12:02 ` [PATCH v1 03/27] block: drbd: remove impossible failure handling Ming Lei 2016-04-14 12:02 ` [PATCH v1 04/27] block: loop: use bio_get_base_vec() to retrive bvec table Ming Lei 2016-04-14 12:02 ` [PATCH v1 05/27] block: pktcdvd: " Ming Lei 2016-04-14 12:02 ` [PATCH v1 06/27] block: floppy: use bio_set_vec_table() Ming Lei 2016-04-14 12:02 ` [PATCH v1 07/27] block: floppy: use bio_add_page() Ming Lei 2016-04-14 12:02 ` Ming Lei [this message] 2016-04-14 12:02 ` [lustre-devel] [PATCH v1 08/27] staging: lustre: avoid to use bio->bi_vcnt directly Ming Lei 2016-04-14 12:02 ` [PATCH v1 09/27] target: avoid to access .bi_vcnt directly Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 10/27] bcache: debug: avoid to access .bi_io_vec directly Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 11/27] bcache: io.c: use bio_set_vec_table Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 12/27] bcache: journal.c: use bio_set_vec_table() Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 13/27] bcache: movinggc: " Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 14/27] bcache: writeback: " Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 15/27] bcache: super: " Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 16/27] bcache: super: use bio_get_base_vec Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 17/27] dm: crypt: use bio_add_page() Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 18/27] dm: dm-io.c: use bio_get_base_vec() Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 19/27] dm: dm.c: replace 'bio->bi_vcnt == 1' with !bio_multiple_segments Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 20/27] dm: dm-bufio.c: use bio_set_vec_table() Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 21/27] fs: logfs: " Ming Lei 2016-04-14 12:02 ` [PATCH v1 22/27] fs: logfs: convert to bio_add_page() in sync_request() Ming Lei 2016-04-14 12:02 ` [PATCH v1 23/27] fs: logfs: use bio_add_page() in __bdev_writeseg() Ming Lei 2016-04-14 12:02 ` [PATCH v1 24/27] fs: logfs: use bio_add_page() in do_erase() Ming Lei 2016-04-14 12:02 ` [PATCH v1 25/27] fs: logfs: remove unnecesary check Ming Lei 2016-04-14 12:02 ` [PATCH v1 26/27] kernel/power/swap.c: use bio_get_base_vec() Ming Lei 2016-04-14 12:02 ` Ming Lei 2016-04-14 12:02 ` [PATCH v1 27/27] mm: page_io.c: " Ming Lei 2016-04-14 12:02 ` Ming Lei
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1460635375-28282-9-git-send-email-tom.leiming@gmail.com \ --to=tom.leiming@gmail.com \ --cc=Julia.Lawall@lip6.fr \ --cc=andreas.dilger@intel.com \ --cc=axboe@fb.com \ --cc=devel@driverdev.osuosl.org \ --cc=fzago@cray.com \ --cc=gregkh@linuxfoundation.org \ --cc=hch@infradead.org \ --cc=john.hammond@intel.com \ --cc=jsimmons@infradead.org \ --cc=kent.overstreet@gmail.com \ --cc=kirill.shutemov@linux.intel.com \ --cc=linux-block@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=lustre-devel@lists.lustre.org \ --cc=mike.rapoport@gmail.com \ --cc=oleg.drokin@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.