From patchwork Tue Apr 5 12:07:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8750871 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D2FCB9F36E for ; Tue, 5 Apr 2016 12:11:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1191B20117 for ; Tue, 5 Apr 2016 12:11:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0448D203AB for ; Tue, 5 Apr 2016 12:11:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933265AbcDEMKg (ORCPT ); Tue, 5 Apr 2016 08:10:36 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33578 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932575AbcDEMKc (ORCPT ); Tue, 5 Apr 2016 08:10:32 -0400 Received: by mail-pf0-f196.google.com with SMTP id e190so1200434pfe.0; Tue, 05 Apr 2016 05:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BisU7n+TZiljK9mUZ0tvVZz+sABfNFjDoGIMEzMCTuY=; b=nvPWGMSHNTXt9FRNs08m46LtEwyl4ydqk37LgmRDJVYrfrIVQauRN0Rz0jVOzyeMNv v1U7X3CoXe5Uj6dIsUnJ/ZKmWDQ4pWSKjf+BL6+Jiky82+bbQ5vSk7X6ooS2VTOJeAxF 5iuqwk/xnMgX0bwOAptsZ5D4gtGBcuRXE2p0e6ujO1BG299De1gyp0NKz5o5QbPJxwgH xwm9AiJXmPhRCWrBidLJht7XrtLpNUFocZyOQnGo+CX37/Y88dQuSXlkdCfsyPr3rb1X ZxvTtbn4GDUQQGkx0g0ADInF9GTS2ZsTN8wvptUnRGW08u5nOlM3h0k+t9YBHMUSAAKN WgTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BisU7n+TZiljK9mUZ0tvVZz+sABfNFjDoGIMEzMCTuY=; b=MGp1Z3vRwNI8TRzbsHnRecV4H/CRsA+CVDsE6N+JVcdDfz5TJapSSWR91IcbnOolQ3 2IAvLwLKpf8RkE0qwl6dDP2v2Xx+3gBDauPb+M01sBGn18Ac0PpOb521pyJQcQOEo70l II5CNJX3XEATxFnyM6xFx3hL9iSL/8ZvpKuek/fWlwRbEhDp0jtwAdpsul67qAl98GrJ JlwF85a2JlJ/F3swBX1vk2l6qchzYhcWO5x5gii8m5cnwsDpY3zDnvgndhbt4Qrvm8wl H/ZoB+VXICcnSeSMsj0L4seaCP4NtHhPDiWNCmlSFi5Wh7zIFYlb37jEgNn2yAZSm6eY J/Tw== X-Gm-Message-State: AD7BkJK/WEeWdB6y6ytA37qlRKCRJUnK0pVqyR5Wgwv9EVvIhdAUJjRUEjdpO5P3QGCdYA== X-Received: by 10.98.86.77 with SMTP id k74mr28257621pfb.28.1459858231378; Tue, 05 Apr 2016 05:10:31 -0700 (PDT) Received: from localhost (56.34.213.162.lcy-01.canonistack.canonical.com. [162.213.34.56]) by smtp.gmail.com with ESMTPSA id ud5sm7528473pac.11.2016.04.05.05.10.26 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 05 Apr 2016 05:10:30 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Boaz Harrosh , Ming Lei , "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org (open list:SUSPEND TO RAM) Subject: [PATCH 26/27] kernel/power/swap.c: use bio_get_base_vec() Date: Tue, 5 Apr 2016 20:07:41 +0800 Message-Id: <1459858062-21075-12-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459858062-21075-1-git-send-email-tom.leiming@gmail.com> References: <1459858062-21075-1-git-send-email-tom.leiming@gmail.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ming Lei --- 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",