Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519747 > unrolled thread

[PATCH 06/12] dm: crypt: use bio_add_page()

Started byMing Lei <tom.leiming@gmail.com>
First post2016-11-11 13:10 +0100
Last post2016-11-21 15:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 06/12] dm: crypt: use bio_add_page() Ming Lei <tom.leiming@gmail.com> - 2016-11-11 13:10 +0100
    Re: [PATCH 06/12] dm: crypt: use bio_add_page() Mike Snitzer <snitzer@redhat.com> - 2016-11-21 15:50 +0100

#1519747 — [PATCH 06/12] dm: crypt: use bio_add_page()

FromMing Lei <tom.leiming@gmail.com>
Date2016-11-11 13:10 +0100
Subject[PATCH 06/12] dm: crypt: use bio_add_page()
Message-ID<sCiOD-48t-49@gated-at.bofh.it>
We have the standard interface to add page to bio, so don't
do that in hacking way.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 drivers/md/dm-crypt.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 68a9eb4f3f36..e4f86bead9d3 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -994,7 +994,6 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned size)
 	gfp_t gfp_mask = GFP_NOWAIT | __GFP_HIGHMEM;
 	unsigned i, len, remaining_size;
 	struct page *page;
-	struct bio_vec *bvec;
 
 retry:
 	if (unlikely(gfp_mask & __GFP_DIRECT_RECLAIM))
@@ -1019,12 +1018,7 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned size)
 
 		len = (remaining_size > PAGE_SIZE) ? PAGE_SIZE : remaining_size;
 
-		bvec = &clone->bi_io_vec[clone->bi_vcnt++];
-		bvec->bv_page = page;
-		bvec->bv_len = len;
-		bvec->bv_offset = 0;
-
-		clone->bi_iter.bi_size += len;
+		bio_add_page(clone, page, len, 0);
 
 		remaining_size -= len;
 	}
-- 
2.7.4

[toc] | [next] | [standalone]


#1526734

FromMike Snitzer <snitzer@redhat.com>
Date2016-11-21 15:50 +0100
Message-ID<sFY4W-2qO-19@gated-at.bofh.it>
In reply to#1519747
On Fri, Nov 11 2016 at  7:05am -0500,
Ming Lei <tom.leiming@gmail.com> wrote:

> We have the standard interface to add page to bio, so don't
> do that in hacking way.
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>

I've staged this for 4.10

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web