Message ID | 20181126021720.19471-13-ming.lei@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 6CDB117FE for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 26 Nov 2018 02:20:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5897229A7A for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 26 Nov 2018 02:20:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F21729A79; Mon, 26 Nov 2018 02:20:32 +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=ham 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 4A48329A43 for <patchwork-linux-mm@patchwork.kernel.org>; Mon, 26 Nov 2018 02:20:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 501F16B3F7E; Sun, 25 Nov 2018 21:20:15 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4D8546B3F7F; Sun, 25 Nov 2018 21:20:15 -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 3A0E56B3F80; Sun, 25 Nov 2018 21:20:15 -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 0E0FB6B3F7E for <linux-mm@kvack.org>; Sun, 25 Nov 2018 21:20:15 -0500 (EST) Received: by mail-qk1-f198.google.com with SMTP id k66so18280268qkf.1 for <linux-mm@kvack.org>; Sun, 25 Nov 2018 18:20:15 -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=c2SF5KIPKkkjYa6soG59vjMHK08LElFkLaPhpIbMqOY=; b=Bvtr5HIvwRVqdA1h6m9EO54KGoABGc/UfGV9+nhgu506apjZIEvZTBjotwzYUU3oTa Oop1g19jRAMt0u58Gt3A9JFg55GZ+H3FRa6D+91vCmy8mbT3uuSMkEj1SUUzl+z+RlKz fHDk1qusGexVslKi90mkyvlS1OAtHFxy58Q57ujMzjiHdsbX2duyETxp4rM2wmQv9Sf4 ftAH2n6/frxZ251u9bN60pyySqs2ZfNH1gWsl7dlQjMNc7iEVQPK707+uwCAaX+f2pip Hk+yWGOdkC/VhJuI1TivEV2lMATgxwPczIgC2Y4ia+S+TWUChsc3/JH1jTkNEnS1ndVj VGrw== 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+aEWaQ+EdntUvPilSfpvQHh+nASAmRD6v2e4m4/dMOFJVU3Mc476pS ti4Yi3ba/lIm9rSu5Urodezl014bT0VcQ/2HoHwOhR/hM1Uu8u37BhVrwkQINzfxcPA97/3C4DV o9AQpRJNwinJ/W8nCYAkKbbe57p/lexZbsJ7vncQ8LO8ACBUiO0IyFVQ5nuVE/VDIXQ== X-Received: by 2002:a37:1fc6:: with SMTP id n67mr23505659qkh.180.1543198814836; Sun, 25 Nov 2018 18:20:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/WN8QAiXEU8t4udM2NtgVLKkRXqx02gmdgA3GYbiBDWlDT9CCAt9VUNR9I0syAgXI3E5F4U X-Received: by 2002:a37:1fc6:: with SMTP id n67mr23505644qkh.180.1543198814316; Sun, 25 Nov 2018 18:20:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543198814; cv=none; d=google.com; s=arc-20160816; b=ouG1bmLoG68YVrVYcJHZbTIGpJEATXdWSHdpiaQYt4lri1vje6L3KHGU8S6OVTV1dN CnFTUCpH6ueh3WwwqGeT8+nzQ8SZoliid9DsKSi9Y5n81QDSgboSWMntTNK9bttqmDj4 Auo8jcDYbdgnyRvEoJBkbMV0gbF6c90I3El+SuH7TWiohP+lfrZs4WMhHT43oD5eZo/a paB5mnjfu1QpjQ9ZCMUDjqu5/zGBX/TEZXfTbIEka9NyBjwjTNJbPsINgAcrBUHhIuDT Wpce67IUMSqDo09n4Q8Sf92JVJSoiTWe+YLfyg5mZamemZK7optCqGTUlDs5bUMD0BUC 3hqQ== 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=c2SF5KIPKkkjYa6soG59vjMHK08LElFkLaPhpIbMqOY=; b=MjAutrBpcbfWg+w1f0MmP8Qhr8IPLYWIT1MtHLxEpBnDOXozPSpBOqwPf7zItPZxby IP3E6ImQhYtD1WVkBAwvJPcp63/CqyOa7IdB6T8bY5YEpTZnQkqYYBi+isyM4v9NlxX9 djttafyt8wwceNe6JwsSEMsk5nTDjwHZpaDxWkTOsmQ1tuF0eJ1zGAprUtQVCW86e0bl xLIoNpgeUC20qG4MhXNRcbi6T3474BmFtVll5eAJb1rTZgQcRvBJOl8Wljq6VXD9AIrX 0EivSwJKmanvx9tEmtXeyr5hy0CyAeBRhyk2JEncf+4qBEwyN0eOb3W4kJvjLnSXN8cg 6e6A== 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 b48si5800396qtk.45.2018.11.25.18.20.14 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Nov 2018 18:20:14 -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-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4191888308; Mon, 26 Nov 2018 02:20:13 +0000 (UTC) Received: from localhost (ovpn-8-19.pek2.redhat.com [10.72.8.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id A53F65DD64; Mon, 26 Nov 2018 02:19:59 +0000 (UTC) From: Ming Lei <ming.lei@redhat.com> To: Jens Axboe <axboe@kernel.dk> Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o <tytso@mit.edu>, Omar Sandoval <osandov@fb.com>, Sagi Grimberg <sagi@grimberg.me>, Dave Chinner <dchinner@redhat.com>, Kent Overstreet <kent.overstreet@gmail.com>, Mike Snitzer <snitzer@redhat.com>, dm-devel@redhat.com, Alexander Viro <viro@zeniv.linux.org.uk>, linux-fsdevel@vger.kernel.org, Shaohua Li <shli@kernel.org>, linux-raid@vger.kernel.org, David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org, "Darrick J . Wong" <darrick.wong@oracle.com>, linux-xfs@vger.kernel.org, Gao Xiang <gaoxiang25@huawei.com>, Christoph Hellwig <hch@lst.de>, linux-ext4@vger.kernel.org, Coly Li <colyli@suse.de>, linux-bcache@vger.kernel.org, Boaz Harrosh <ooo@electrozaur.com>, Bob Peterson <rpeterso@redhat.com>, cluster-devel@redhat.com, Ming Lei <ming.lei@redhat.com> Subject: [PATCH V12 12/20] fs/buffer.c: use bvec iterator to truncate the bio Date: Mon, 26 Nov 2018 10:17:12 +0800 Message-Id: <20181126021720.19471-13-ming.lei@redhat.com> In-Reply-To: <20181126021720.19471-1-ming.lei@redhat.com> References: <20181126021720.19471-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 26 Nov 2018 02:20:13 +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: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
block: support multi-page bvec
|
expand
|
diff --git a/fs/buffer.c b/fs/buffer.c index 1286c2b95498..fa37ad52e962 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3032,7 +3032,10 @@ void guard_bio_eod(int op, struct bio *bio) /* ..and clear the end of the buffer for reads */ if (op == REQ_OP_READ) { - zero_user(bvec->bv_page, bvec->bv_offset + bvec->bv_len, + struct bio_vec bv; + + bvec_last_segment(bvec, &bv); + zero_user(bv.bv_page, bv.bv_offset + bv.bv_len, truncated_bytes); } }