[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1460635375-28282-27-git-send-email-tom.leiming@gmail.com>
Date: Thu, 14 Apr 2016 20:02:44 +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>,
Ming Lei <tom.leiming@...il.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
linux-pm@...r.kernel.org (open list:SUSPEND TO RAM)
Subject: [PATCH v1 26/27] kernel/power/swap.c: use bio_get_base_vec()
Signed-off-by: Ming Lei <tom.leiming@...il.com>
---
kernel/power/swap.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 12cd989..cedf752 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -230,7 +230,15 @@ static void hib_init_batch(struct hib_bio_batch *hb)
static void hib_end_io(struct bio *bio)
{
struct hib_bio_batch *hb = bio->bi_private;
- 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) {
printk(KERN_ALERT "Read-error on swap-device (%u:%u:%Lu)\n",
--
1.9.1
Powered by blists - more mailing lists