From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@fb.com>, linux-block@vger.kernel.org
Cc: Christoph Hellwig <hch@infradead.org>, Ming Lei <ming.lei@redhat.com>
Subject: [PATCH 03/10] fs: convert to bio_last_bvec()
Date: Fri, 8 Dec 2017 21:14:02 +0800 [thread overview]
Message-ID: <20171208131409.11889-4-ming.lei@redhat.com> (raw)
In-Reply-To: <20171208131409.11889-1-ming.lei@redhat.com>
This patch convers 3 users to bio_last_bvec(), so that we can go ahread
to convert to multipage bvec.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
fs/btrfs/compression.c | 2 +-
fs/btrfs/extent_io.c | 2 +-
fs/buffer.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index fc0386c18574..726e1b5b06fe 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -411,7 +411,7 @@ blk_status_t btrfs_submit_compressed_write(struct inode *inode, u64 start,
static u64 bio_end_offset(struct bio *bio)
{
- struct bio_vec *last = &bio->bi_io_vec[bio->bi_vcnt - 1];
+ struct bio_vec *last = bio_last_bvec(bio);
return page_offset(last->bv_page) + last->bv_len + last->bv_offset;
}
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 012d63870b99..6f6669f93beb 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2724,7 +2724,7 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
unsigned long bio_flags)
{
blk_status_t ret = 0;
- struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
+ struct bio_vec *bvec = bio_last_bvec(bio);
struct page *page = bvec->bv_page;
struct extent_io_tree *tree = bio->bi_private;
u64 start;
diff --git a/fs/buffer.c b/fs/buffer.c
index 0736a6a2e2f0..ceb705ba939f 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -3014,7 +3014,7 @@ static void end_bio_bh_io_sync(struct bio *bio)
void guard_bio_eod(int op, struct bio *bio)
{
sector_t maxsector;
- struct bio_vec *bvec = &bio->bi_io_vec[bio->bi_vcnt - 1];
+ struct bio_vec *bvec = bio_last_bvec(bio);
unsigned truncated_bytes;
struct hd_struct *part;
--
2.9.5
next prev parent reply other threads:[~2017-12-08 13:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 13:13 [PATCH 00/10] block: cleanup on direct access to bvec table(prepare for multipage bvec) Ming Lei
2017-12-08 13:14 ` [PATCH 01/10] block: introduce bio helpers for converting to multipage bvec Ming Lei
2017-12-08 13:14 ` [PATCH 02/10] block: conver to bio_first_bvec() & bio_first_page() Ming Lei
2017-12-08 13:14 ` Ming Lei [this message]
2017-12-08 13:14 ` [PATCH 04/10] block: bounce: avoid direct access to bvec table Ming Lei
2017-12-08 13:14 ` [PATCH 05/10] block: bounce: don't access bio->bi_io_vec in copy_to_high_bio_irq Ming Lei
2017-12-08 13:14 ` [PATCH 06/10] dm: limit the max bio size as BIO_MAX_PAGES * PAGE_SIZE Ming Lei
2017-12-08 13:14 ` [PATCH 07/10] bcache: comment on direct access to bvec table Ming Lei
2017-12-08 13:14 ` [PATCH 08/10] block: move bio_alloc_pages() to bcache Ming Lei
2018-01-08 18:05 ` Michael Lyle
2018-01-09 1:21 ` Ming Lei
2017-12-08 13:14 ` [PATCH 09/10] btrfs: avoid access to .bi_vcnt directly Ming Lei
2017-12-08 13:14 ` [PATCH 10/10] btrfs: avoid to access bvec table directly for a cloned bio Ming Lei
2017-12-12 7:57 ` [PATCH 00/10] block: cleanup on direct access to bvec table(prepare for multipage bvec) Christoph Hellwig
2017-12-12 9:18 ` Ming Lei
2017-12-13 17:55 ` Ming Lei
2018-01-05 19:02 ` Jens Axboe
2018-01-06 9:18 ` Ming Lei
2018-01-06 16:21 ` Jens Axboe
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=20171208131409.11889-4-ming.lei@redhat.com \
--to=ming.lei@redhat.com \
--cc=axboe@fb.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).