From patchwork Wed Nov 21 03:23:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10691685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1422E13BB for ; Wed, 21 Nov 2018 03:26:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 021B32B409 for ; Wed, 21 Nov 2018 03:26:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E99DA2B412; Wed, 21 Nov 2018 03:26:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 940792B40C for ; Wed, 21 Nov 2018 03:26:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B600F6B23A1; Tue, 20 Nov 2018 22:26:47 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B0F606B23A3; Tue, 20 Nov 2018 22:26:47 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D8DA6B23A4; Tue, 20 Nov 2018 22:26:47 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by kanga.kvack.org (Postfix) with ESMTP id 6BC566B23A1 for ; Tue, 20 Nov 2018 22:26:47 -0500 (EST) Received: by mail-qt1-f200.google.com with SMTP id n95so2196201qte.16 for ; Tue, 20 Nov 2018 19:26:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=VqUMvNlEfNjUE6i3yi2LxyYeVZbGn1qv90D3YZNYJU4=; b=LW3KuOnjcUGORK4kdBuhiUtXEAWXW8Z10xw0c9mswPzQb0cZ2GBow8XPgqC1zYejTR AX32Ns/a2Iz9tb1GXn+Pl5W/kXt4RFYMR0bksa02zWe9Un3p5+F2swJ1M6MWKhzk8RC0 8qiNn1ewm/NVhwYaePLqqzXntNM92tV3aPwu94JjimTheE+f2T/ecjtQWg4fdLBfm9Yv bXQ2MuytNaaulmKMDaimMm/p4w39GwdT0OqElXl2MN07vr0p157oZm6e59tY0sma6gHO hwLjvSwQYydjYVgFLO5lnBdBV80rgfPiWPgqF8IS1lJ5ubbykIQW2oePSxExhmwEcymO 5Cjg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AA+aEWYdKK8kZ7zOlKuW44wXdhZE1NIdIq2olgjAh8rHwqVsZX5H+WAR OSFMieUpaZ8mZRheSFae6qkC19W7oMAGhVeDzcec0CvXKyo/MMyBWSRwNoZUylR2rxZbuiI6xuh BzfpZuh9d88iopT03PUYC+86kQTJ+PHedp/r1iHMOExPddOopD66EQdBW00dwoba2aQ== X-Received: by 2002:a0c:e789:: with SMTP id x9mr4399427qvn.245.1542770807222; Tue, 20 Nov 2018 19:26:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/WFCMtDD0XzzS9Lbj52Lj+kWYKdSdzZKSMEBdUPtXTCDecA+0rQcfz3ZlzQCi7+vAvVJA4y X-Received: by 2002:a0c:e789:: with SMTP id x9mr4399410qvn.245.1542770806684; Tue, 20 Nov 2018 19:26:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542770806; cv=none; d=google.com; s=arc-20160816; b=dNqYeRKTSyPRIpQgB7YC3i9sj8dobVmbDhn5leDxV075I4a6JBJBlT0WVl5SI+VIwH VKdubW66kMJ9WpSQrYXNyFXT+rrxsnATxnYDt/PWm/1XO7pS3hd9GJCGl87H1AF7jESP P+LN+LcYywBpa+DtBMbbAtbX3g0+YwaBVLlycACaE9yNQlN1RJ1gmW4UcV+zhKJHYEXD fSkBsIMoh9Wf46ughUQ/N502ESWxuuw0Ue33puA0zzx/xY0eTOyzOksB3s4B2U0av9Oz llqUnEz8hSKLou/GQNBAZCb/NKdzgIjDxYaZupeAVwROYwkNr11pxMz+ckAHWUtPtFX+ a6hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=VqUMvNlEfNjUE6i3yi2LxyYeVZbGn1qv90D3YZNYJU4=; b=U9njWTG5AqdHpZ+aEDsGOr2NdCkKqIr/mZ1MQy67LVkeQecZy93W39o9vgojcpWSq6 Nf45+bQmZtukupyrvWCJf29/VG3FiVrUqy30Aa6xKmF/5QtlfwykJ3dNFzM73BGCV0Dn IjVZM/08blGR/qpw1610pw5C8Mk5ZBJ5covbuHsJ5Niuae4XCsjD++zirxsS/vKVWOvm F4FGE3oeQybD3Ux7hfdwPDOS1/tsUemTIpRikvpYJJKqDCJr0xdKA9Rr3UWuW2RwpLEk 8Xrnrg5rtiEh38kcewgCK9KsV9Fm+ZJs2jgqa9s8qUF5Qh5ae//Cr7nzrCj5duHyNkrg T8kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id 26si5736971qvl.219.2018.11.20.19.26.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 19:26:46 -0800 (PST) Received-SPF: pass (google.com: domain of ming.lei@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94672C058CA6; Wed, 21 Nov 2018 03:26:45 +0000 (UTC) Received: from localhost (ovpn-8-21.pek2.redhat.com [10.72.8.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 924975C226; Wed, 21 Nov 2018 03:26:37 +0000 (UTC) From: Ming Lei To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , Omar Sandoval , Sagi Grimberg , Dave Chinner , Kent Overstreet , Mike Snitzer , dm-devel@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, Shaohua Li , linux-raid@vger.kernel.org, David Sterba , linux-btrfs@vger.kernel.org, "Darrick J . Wong" , linux-xfs@vger.kernel.org, Gao Xiang , Christoph Hellwig , linux-ext4@vger.kernel.org, Coly Li , linux-bcache@vger.kernel.org, Boaz Harrosh , Bob Peterson , cluster-devel@redhat.com, Ming Lei Subject: [PATCH V11 08/19] btrfs: use bvec_last_segment to get bio's last page Date: Wed, 21 Nov 2018 11:23:16 +0800 Message-Id: <20181121032327.8434-9-ming.lei@redhat.com> In-Reply-To: <20181121032327.8434-1-ming.lei@redhat.com> References: <20181121032327.8434-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 21 Nov 2018 03:26:45 +0000 (UTC) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Preparing for supporting multi-page bvec. Reviewed-by: Omar Sandoval Signed-off-by: Ming Lei --- fs/btrfs/extent_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index d228f706ff3e..5d5965297e7e 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2720,11 +2720,12 @@ static int __must_check submit_one_bio(struct bio *bio, int mirror_num, { blk_status_t ret = 0; struct bio_vec *bvec = bio_last_bvec_all(bio); - struct page *page = bvec->bv_page; + struct bio_vec bv; struct extent_io_tree *tree = bio->bi_private; u64 start; - start = page_offset(page) + bvec->bv_offset; + bvec_last_segment(bvec, &bv); + start = page_offset(bv.bv_page) + bv.bv_offset; bio->bi_private = NULL;