提交 c45a8f2d 编写于 作者: M Ming Lei 提交者: Jens Axboe

fs: convert to bio_last_bvec_all()

This patch converts 3 users to bio_last_bvec_all(), so that we can go
ahead and convert to multipage bvec.
Signed-off-by: NMing Lei <ming.lei@redhat.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 263663cd
...@@ -411,7 +411,7 @@ blk_status_t btrfs_submit_compressed_write(struct inode *inode, u64 start, ...@@ -411,7 +411,7 @@ blk_status_t btrfs_submit_compressed_write(struct inode *inode, u64 start,
static u64 bio_end_offset(struct bio *bio) 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_all(bio);
return page_offset(last->bv_page) + last->bv_len + last->bv_offset; return page_offset(last->bv_page) + last->bv_len + last->bv_offset;
} }
......
...@@ -2724,7 +2724,7 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num, ...@@ -2724,7 +2724,7 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num,
unsigned long bio_flags) unsigned long bio_flags)
{ {
blk_status_t ret = 0; blk_status_t ret = 0;
struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; struct bio_vec *bvec = bio_last_bvec_all(bio);
struct page *page = bvec->bv_page; struct page *page = bvec->bv_page;
struct extent_io_tree *tree = bio->bi_private; struct extent_io_tree *tree = bio->bi_private;
u64 start; u64 start;
......
...@@ -3014,7 +3014,7 @@ static void end_bio_bh_io_sync(struct bio *bio) ...@@ -3014,7 +3014,7 @@ static void end_bio_bh_io_sync(struct bio *bio)
void guard_bio_eod(int op, struct bio *bio) void guard_bio_eod(int op, struct bio *bio)
{ {
sector_t maxsector; sector_t maxsector;
struct bio_vec *bvec = &bio->bi_io_vec[bio->bi_vcnt - 1]; struct bio_vec *bvec = bio_last_bvec_all(bio);
unsigned truncated_bytes; unsigned truncated_bytes;
struct hd_struct *part; struct hd_struct *part;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册