Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp874361imj; Fri, 15 Feb 2019 08:12:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IZmkcVBsC/JHIw7DN08hhxuiBg3euv47Ff+Fcb/TUtLE7PdOq/d8IPuXRVqw/thLu6qy7tZ X-Received: by 2002:a62:1212:: with SMTP id a18mr10513158pfj.177.1550247165545; Fri, 15 Feb 2019 08:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550247165; cv=none; d=google.com; s=arc-20160816; b=q+thntKPW8JzhZUN04VGYdRcICDx5alZx7tBSnWoEn3B83sNM9plr2mZRroE/s1UOz YB0ezDO/+fNBZ+MR+yEWWhNX5w7MI2449fQcnFhT+Ukw2hCEo2BhDN9ciWBDwLTNJioQ M6v3+lK73UqrGQgZqEbGM8kVgaxQOobkbdUWpv9lSnoBnX4j+i1iEW35Eg1MVqlCO2+v os74Xh1FBC6NtCIXES/Q8tSLTCFH9ZZtn6Wc1Qwt38jUO2BnEuPY9AbgSiDE9CAI28sr 0Ei5LREDuBkJT812nMne1XoMtvjihP+32FO48VlNUTxyuER/zCduONTRKM6y+R9wIOde LNWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=QsyyCrPYM4mSQKLdRXgny5EZIKPBaVsU+ab/s6p3Gys=; b=Pdr3JQDp/n12B1Xec5q2+XqTZneGyTnIAFnv5+TzCa0aIaOq1uvC4YahnowjLRCq+2 keGVx2ftMLvBCcW2PZIm/HlGknI1w9U13RQ792s8z11/31nhLtrGIUqwRIY1qSSOXCJh oU4sHdoVWVE365q1tRdfyLj/N7yPhbtVkpDFMr8ask6zm9XPUP7f2IvI8bkg2AtBIG5t fPnCtKOhf+YIcBWCcOG3KKFPBtb2SCTuOdQEjEDL3czYP3XU7Qg7ojmwQ+yzNLmjHfYR nmQGdZ6QLHn/DJ66d4QW0HG6FfDpaF/82qbRFQ8VKn+SZ5/pbmCH0L1o51Jib1ZlIvow aqTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o9si4354430pll.303.2019.02.15.08.12.29; Fri, 15 Feb 2019 08:12:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394343AbfBOLQT (ORCPT + 99 others); Fri, 15 Feb 2019 06:16:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51118 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394308AbfBOLQQ (ORCPT ); Fri, 15 Feb 2019 06:16:16 -0500 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.9.5