lkml.org 
[lkml]   [2016]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 27/27] mm: page_io.c: use bio_get_base_vec()
Date
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
mm/page_io.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index cd92e3d..1ced9d3 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -43,7 +43,14 @@ static struct bio *get_swap_bio(gfp_t gfp_flags,

void end_swap_bio_write(struct bio *bio)
{
- struct page *page = bio->bi_io_vec[0].bv_page;
+ /*
+ * Single bvec bio.
+ *
+ * For accessing page pointed to by the 1st bvec, it
+ * works too after multipage bvecs.
+ */
+ struct bio_vec *bvec = bio_get_base_vec(bio);
+ struct page *page = bvec->bv_page;

if (bio->bi_error) {
SetPageError(page);
@@ -116,7 +123,14 @@ static void swap_slot_free_notify(struct page *page)

static void end_swap_bio_read(struct bio *bio)
{
- struct page *page = bio->bi_io_vec[0].bv_page;
+ /*
+ * Single bvec bio.
+ *
+ * For accessing page pointed to by the 1st bvec, it
+ * works too after multipage bvecs.
+ */
+ struct bio_vec *bvec = bio_get_base_vec(bio);
+ struct page *page = bvec->bv_page;

if (bio->bi_error) {
SetPageError(page);
--
1.9.1
\
 
 \ /
  Last update: 2016-04-14 14:21    [W:0.439 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site