From patchwork Fri Jan 11 11:01:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10757753 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 4BD7A14E5 for ; Fri, 11 Jan 2019 11:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FA8229AF7 for ; Fri, 11 Jan 2019 11:04:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22D7A29BEE; Fri, 11 Jan 2019 11:04:37 +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 BD1F129BC7 for ; Fri, 11 Jan 2019 11:04:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D85688E000D; Fri, 11 Jan 2019 06:04:35 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D673E8E0001; Fri, 11 Jan 2019 06:04:35 -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 C4E5A8E000D; Fri, 11 Jan 2019 06:04:35 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by kanga.kvack.org (Postfix) with ESMTP id 9B5C18E0001 for ; Fri, 11 Jan 2019 06:04:35 -0500 (EST) Received: by mail-qt1-f198.google.com with SMTP id q3so16262477qtq.15 for ; Fri, 11 Jan 2019 03:04:35 -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=XsPc+1MY7uPsNa4DIKA+z9obYPPIRMYTuVF6XbdsXSw=; b=R9+Sp49wv+uIU9GbY1SdVIQ8rNp8Yr5+sooSTpvOjea8EXdxSanZAi/9crBdrB33c3 Ny6Q21vcEdssfmoTipZpyL+NWbK8bjuLT8AF3kaLJuTqJtYy/k1SPgjx6nvd2a+WstyH C1kDBREOFHgaxfHyWICfU4l+M8brRCSs3/hzZosY6d7dHdwXOVjpqgpcPUyZR9y1gPKb NGP+nJaRWnFCKJc+A+vBtMGyfgV6wIkqM4ZdajXomazkzkdUqLX74aQLgcBFRqNlTUas MUnCvnWbwsg8EJYK2aOx7rLEKurAwyvLDgEHsP+aOIgJNDAbRRsRvj80k8VjxIuTCsPF 1q1g== 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: AJcUukfE4k8OE8S8uNND5CmwDwMFQCB5w6+wK8R8iEemc4C7YLAwuNlN 4CFYzQBgitTJpVXMHPJRWvX8z298Y5dey8v0blwbYJ8JpvzwIT1zCVdb8dZA76lAOaHwmfdRSPB a3L8wDzmCJdkdzsNGv9BRK7HK3MuXuU9HMItwzvTJt0LwQk89A0FT6iE9auTq2YHYAQ== X-Received: by 2002:a0c:89e9:: with SMTP id 38mr13552754qvs.31.1547204675431; Fri, 11 Jan 2019 03:04:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN5UIGhKwpTZMWSmAuGOUUwrcJJ0zq81Y0Uq2mFD1CuT33OoQoXpNq93qlK96fHaCv/UBxGQ X-Received: by 2002:a0c:89e9:: with SMTP id 38mr13552723qvs.31.1547204674962; Fri, 11 Jan 2019 03:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547204674; cv=none; d=google.com; s=arc-20160816; b=jcX3ZEKVCYUxUSEJ8UX/gbeTDMrnPnq5BGhliFyoj6xhXP+2ZrHa3z3b9swLu7Y6y6 IVMYiJXYLRA/BgL3SLUCfxPAOVStmHB+jnKR2i7SRp7M1UJP/gtr3QALy3d+v+t5zzaI QVL59ti3GoWeYyUKr7K25Gaz3kQWYhtZWOoBwjXtH1vt7+vEvcv05JNbheyqLuMGZErx 5A9phJtj2ot4ufwItOEJMsoBCtJO+KDFtXz+EO5myBMx6iuZLEs0p6GMZ/VDIZ50+2j9 pMYz2FTuVOuEJMvswBrQPNIuQQ/0f/Z1h+mjIWfGaOOGF4DwASBBgMuH3yjpXUWkdzdD 4FjQ== 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=XsPc+1MY7uPsNa4DIKA+z9obYPPIRMYTuVF6XbdsXSw=; b=LpPNLlNt1RkxGMRwhWL0Q8ZozEEoJ4HTN9OBaA/yGEKUb/uw8aQxYa0YJfsqvaKH9H 4rChC3xEa5y6Ra4ZO0NxeZ07FBE/EeEJ4PeHbkTG+/fpsUivZ0xPqaNu96H60TA3MBTL NsMDLp2p+NtTk0UXYl5nqZIk37S0qd0Bh7x5KMAOpBTx/JiQgR9XsniXz76LlsFEizDi kW87BFl/2nYNbHhDMSNeERS6IN6XTIKEUznEESdcjMHerK4rkKi0//jdhJNVd1AvsgzJ uOhjzv58vKgSrtuBESc1jhuBD8EUmdlYCojHN2l+tEIFlzUATyNvaJLkHmwqptYkBMCd 8x8g== 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 v67si1738896qkd.63.2019.01.11.03.04.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jan 2019 03:04:34 -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 C4ADBC0C9A8B; Fri, 11 Jan 2019 11:04:33 +0000 (UTC) Received: from localhost (ovpn-8-28.pek2.redhat.com [10.72.8.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E72360603; Fri, 11 Jan 2019 11:04:21 +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 V13 11/19] btrfs: use bvec_last_segment to get bio's last page Date: Fri, 11 Jan 2019 19:01:19 +0800 Message-Id: <20190111110127.21664-12-ming.lei@redhat.com> In-Reply-To: <20190111110127.21664-1-ming.lei@redhat.com> References: <20190111110127.21664-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.32]); Fri, 11 Jan 2019 11:04:34 +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..c092f88700bd 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; + bvec_last_segment(bvec, &bv); + start = page_offset(bv.bv_page) + bv.bv_offset; bio->bi_private = NULL;