From patchwork Fri Feb 15 11:13:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10814663 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 EED4A17E0 for ; Fri, 15 Feb 2019 11:16:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6F7D2EAE8 for ; Fri, 15 Feb 2019 11:16:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA9B62EE6D; Fri, 15 Feb 2019 11:16:18 +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 8E5D82EE56 for ; Fri, 15 Feb 2019 11:16:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 96D6E8E000C; Fri, 15 Feb 2019 06:16:17 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8F5F08E0001; Fri, 15 Feb 2019 06:16:17 -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 7BF0C8E000C; Fri, 15 Feb 2019 06:16:17 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id 4F4228E0001 for ; Fri, 15 Feb 2019 06:16:17 -0500 (EST) Received: by mail-qk1-f198.google.com with SMTP id a199so7662803qkb.23 for ; Fri, 15 Feb 2019 03:16:17 -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=QsyyCrPYM4mSQKLdRXgny5EZIKPBaVsU+ab/s6p3Gys=; b=HjCrG0WvzxY7TD5V2hBMJv3rXAQTYfOjZKok7DyZ9skprkzbzxVZ9iuRfc1CH2hSjS TTbgLk5iCbprJGJdNXM9WyBLWb0yBUuUGVZS0xdabwyUO/pWwZ1h0pO3o6lrBoJaXR4A rM6LdBEddQHZ2a3FNgjQEtY+mGhNs0bcqR+ppULEDSzjlZ0VUPme7AvNFbX+W3+NIWuN mmF/fCdwqljwlPa1/9JIGCwi1UMOoq/iwl3mLLPGfU7kANfSHroJI5eGWFvgQt+RqLOM eWKZCjSr4DEUbbvH+jfNwF4ptfuy3P6C2axpfwhqdbKh6DOZRA5ehyqdwBTNFjcyBTku W++Q== 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: AHQUAuaf2rPJCubmAVRVmM3c1nCfNjZNaoOEQdaTjNx2G6DQGBdXDr4R +8SjRB9BoeVEnLSkSQNwJ0tTTl1NWVZCok5o8xe+m7mORDjgEfY0sp9MAYH1Hzxg8h2h+mzCGIw q4Tjl+2KHoT9BssGfQqAOzeTbbV+YlrO1PbjLFdz+OWS6A/oYb4ty2200CPBc68bHgg== X-Received: by 2002:ae9:ddc3:: with SMTP id r186mr6531868qkf.163.1550229377105; Fri, 15 Feb 2019 03:16:17 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibw2DDDE18GImCftpz1KZ+IjTfcxi5G83X+ajSvabQ+5YmY125OoJO2OiofJbf+IgZC/kUT X-Received: by 2002:ae9:ddc3:: with SMTP id r186mr6531838qkf.163.1550229376623; Fri, 15 Feb 2019 03:16:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550229376; cv=none; d=google.com; s=arc-20160816; b=NN5Atc3yoL0yrjX2zADRQ3K2zz+z1vawlftJGin5CVD/VRKULoiSMlPk32wC/KDEKQ ujOWWmOAPWAUyCh/U8bZAiHcwVd2tCATdmVrWzIYh+OLRqdCcSbvOXcV8Q92ovqADKIN d0fEyT8BlW2ota/HySiGzj5hjYwrKgbm42+QRYGENgSzD1vAq42mArRk5JUq650F41g7 T9PXsq+EocBe8zuUI3AsAuDLhBIn6wQK0ZtFxS34blRHRsqtc4mQSBrDrJOpl5Evqhs6 NOeNiypGD6+1YRPCNn5h6cguVqrK96ZnrIqG4zwUacvlUwyC8RKahFak4Vi88hh42qGB pTxA== 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=QsyyCrPYM4mSQKLdRXgny5EZIKPBaVsU+ab/s6p3Gys=; b=yHJ8q0r1u6YYHEFJubYhYF5YsTc+87Xh0n3kdh+Su/tnu72pXAjvGOr3VYWaBsqc5I bbtHB4JV3TCcBNzHclOu2kZy/9m3suCgHelC2QzSogDUFFdXQ2jyCvr2WNMR1mC3UqJK beTGAtH9ZpIErdrpxozS6adJFKpTqW6yO2bNYRxOKYRYPeqkEn05e5RlB+876iyZBZZB 5QfHnxcDmPmsd8+SdcWGLwEjR7K+aW/OhZLMKg7sO6ejP7HvWeZvoDUNaASB5wTuHAfI 1+3ppeKrOOzZ3s1caqg+3FUxqJQ1NJpQynckptc/TPxThH9fYawBgyRvFhjrwloo7BGC A+lA== 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 w3si3355857qth.85.2019.02.15.03.16.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Feb 2019 03:16:16 -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-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CEA2C0AD406; Fri, 15 Feb 2019 11:16:15 +0000 (UTC) Received: from localhost (ovpn-8-22.pek2.redhat.com [10.72.8.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 077AD60A9C; Fri, 15 Feb 2019 11:16:13 +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, 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 V15 10/18] btrfs: use mp_bvec_last_segment to get bio's last page Date: Fri, 15 Feb 2019 19:13:16 +0800 Message-Id: <20190215111324.30129-11-ming.lei@redhat.com> In-Reply-To: <20190215111324.30129-1-ming.lei@redhat.com> References: <20190215111324.30129-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 15 Feb 2019 11:16:15 +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 dc8ba3ee515d..986ef49b0269 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2697,11 +2697,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; + mp_bvec_last_segment(bvec, &bv); + start = page_offset(bv.bv_page) + bv.bv_offset; bio->bi_private = NULL;