[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1459858062-21075-13-git-send-email-tom.leiming@gmail.com>
Date: Tue, 5 Apr 2016 20:07:42 +0800
From: Ming Lei <tom.leiming@...il.com>
To: Jens Axboe <axboe@...com>, linux-kernel@...r.kernel.org
Cc: linux-block@...r.kernel.org, Christoph Hellwig <hch@...radead.org>,
Boaz Harrosh <boaz@...xistor.com>,
Ming Lei <tom.leiming@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dongsu Park <dpark@...teo.net>,
Minchan Kim <minchan@...nel.org>, Tejun Heo <tj@...nel.org>,
Joe Perches <joe@...ches.com>,
Kent Overstreet <kent.overstreet@...il.com>,
Omar Sandoval <osandov@...ndov.com>,
linux-mm@...ck.org (open list:MEMORY MANAGEMENT)
Subject: [PATCH 27/27] mm: page_io.c: use bio_get_base_vec()
Signed-off-by: Ming Lei <tom.leiming@...il.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 18aac78..b5a6baf 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
Powered by blists - more mailing lists