From patchwork Thu Apr 14 12:02:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8834981 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F3EEAC0554 for ; Thu, 14 Apr 2016 12:04:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1DAE8201D3 for ; Thu, 14 Apr 2016 12:04:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FBB120166 for ; Thu, 14 Apr 2016 12:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755229AbcDNMEz (ORCPT ); Thu, 14 Apr 2016 08:04:55 -0400 Received: from mail-ob0-f194.google.com ([209.85.214.194]:36787 "EHLO mail-ob0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755084AbcDNMDs (ORCPT ); Thu, 14 Apr 2016 08:03:48 -0400 Received: by mail-ob0-f194.google.com with SMTP id rf6so4872041obc.3; Thu, 14 Apr 2016 05:03:48 -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=Pc4gHC9bJcR73h2IhZ/MmGIaKn/jxULB+sO1CkSkKnZeOnpggt7o4gbOmqvm119wqZ CqHm5IRvnyvUDsbyMpiSQGdn/e2IliZdMvB9kIJbagBKJfHli0TurdJ+DwDSep9CFU8u u7Ky2uQwD8KDW7pEGLheFxavR09fHhaBBmo0Rnv8vdLyirhbOmmvmFuTTpo+dCpmbjTb EQ+D528M5mMC4UFbY2ieCNJdiPm2ZKjMsmkfE0tC+IXo0aDdxYDamIL6sDcBm1drKuxU sbmN5JBQt0pq5Qh4OpkOIxTqehQj3ubdxAA3Bpf7p1Nva/XPnKS2xEUHjYSxKBvoBUZt ZEWQ== 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=ZxTLqL902QgVdafeaFATno1ERy6ADGardlRb8pvl58+t9LjmAdhQgHKgsFGQf04eEp wHEu5Y74Sfl3Fi+VYB96dt9RCEIBVoIee5uA9rbugldbKJ6nHQh7f5wtC1UJ6AEJbkUf 7npR4Jz9knkFrBuNx/EwDWZx8ifpql9SkVSmy2/vWMk2ncGVJzhdsD8R3gK1nHQv0ye0 FUFesaOvbvE4WIdtIdCTO4rU1LZExiwnAcfk4CmgyM4zgPosH5b1sntENnOMz0S7zqH4 rw970z9GWPz7hLQjqCdWV/D+/84BYmj0iH9CSwN0s4nsoUT56fZH0rhs0oOFlhFUIfGF G/uA== X-Gm-Message-State: AOPr4FXn/7ySn2p0Rqxyy2WkovBqhKdS4rsUI7jJ5qTZjRrlslxur8qDmINfEJDA+7YSdQ== X-Received: by 10.182.28.168 with SMTP id c8mr7897281obh.49.1460635427946; Thu, 14 Apr 2016 05:03:47 -0700 (PDT) Received: from localhost ([12.228.154.70]) by smtp.gmail.com with ESMTPSA id t3sm4689292oem.3.2016.04.14.05.03.47 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 14 Apr 2016 05:03:47 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org (open list:SUSPEND TO RAM) Subject: [PATCH v1 26/27] kernel/power/swap.c: use bio_get_base_vec() Date: Thu, 14 Apr 2016 20:02:44 +0800 Message-Id: <1460635375-28282-27-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460635375-28282-1-git-send-email-tom.leiming@gmail.com> References: <1460635375-28282-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",