From patchwork Mon Jan 30 09:21:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4107AC54EED for ; Mon, 30 Jan 2023 09:24:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 723316B0093; Mon, 30 Jan 2023 04:24:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D1DE6B008A; Mon, 30 Jan 2023 04:24:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45EC36B0095; Mon, 30 Jan 2023 04:24:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2A3C76B0081 for ; Mon, 30 Jan 2023 04:24:47 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0C427A09EB for ; Mon, 30 Jan 2023 09:24:47 +0000 (UTC) X-FDA: 80410930614.04.22FCA52 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf08.hostedemail.com (Postfix) with ESMTP id 6A8BA160004 for ; Mon, 30 Jan 2023 09:24:45 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="Qx6f/vAl"; spf=temperror (imf08.hostedemail.com: error in processing during lookup of BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org: DNS error) smtp.mailfrom=BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675070685; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=iTork4lgSqwAnNzEK3lzK1UwHk37chVOVoUGPRhe1ko=; b=zHk/MfYh/T8VPD/MDfzyqFeVf/Ex6Mj4omdnaDPa+2mOQx/XXvDA7oiOo/GM7OuTRGM8we 3RBtIiSj19qCuthMOEoJcV/APt8vEsIyCiEzLVVPZjTGoZ1mTd4TxxyRyCPbBJN6RtVkvq 0ta/uj1xO8/LB3OzNOck7fhS+6D1W6Y= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="Qx6f/vAl"; spf=temperror (imf08.hostedemail.com: error in processing during lookup of BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org: DNS error) smtp.mailfrom=BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675070685; a=rsa-sha256; cv=none; b=NL98wYUD2OCQXTkfUOI90ywIMd+ETzxFGSeI4TpgzQO5f6IzIL9A4+v8F41Z3hspJbCopM jg/qVz3QLaPu0AH7UYmZ+cq7RwV1WVKN2Ai5IL2BLjXgBKY1vIlcvGL8/szZ42ZDxX0vAG /bOvfMuuDpWD0fbn5/mC6t9doMtYq7k= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=iTork4lgSqwAnNzEK3lzK1UwHk37chVOVoUGPRhe1ko=; b=Qx6f/vAlt0702Bw2gaA0yw3fMn DSbWXckp85GKL6x2K0wVZWlmBP/HHAMGhBrYB08/Vlm/YRJQCq3kI3xMG/WASmjfzQ5X57qRgvH1M aDf2q/VfFfkAfOqqUqPetL8Nnll6XIjG7NgvoDUHbD0cnB+MO8UuF7ljYLg4f4YTGaLPU4yXfmMbt xSZ2xC24sTznBHqPUwQ2KOdIbwsTxD5YqcKUievCZTrFdiYRp348Iffsdx6IiKzBdbwdD1fWYnp87 CKqOs2Hi1NMEf6sOsnEZOuE8nGXc6MpsuZ0+93w6fPSfAyQf9ElR2gHbrsn8rljB8JPoxhMSuKyqW Ecg9ip0g==; Received: from [2001:4bb8:19a:272a:732e:e417:47d7:2f4a] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMQNF-002oFW-6t; Mon, 30 Jan 2023 09:22:49 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Ilya Dryomov , "Michael S. Tsirkin" , Jason Wang , Minchan Kim , Sergey Senozhatsky , Keith Busch , Sagi Grimberg , Chaitanya Kulkarni , "Martin K. Petersen" , David Howells , Marc Dionne , Xiubo Li , Steve French , Trond Myklebust , Anna Schumaker , Mike Marshall , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Chuck Lever , linux-block@vger.kernel.org, ceph-devel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, devel@lists.orangefs.org, io-uring@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 14/23] coredump: use bvec_set_page to initialize a bvec Date: Mon, 30 Jan 2023 10:21:48 +0100 Message-Id: <20230130092157.1759539-15-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230130092157.1759539-1-hch@lst.de> References: <20230130092157.1759539-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: ep37x5sz735tfh7xfj814h7m8a35xmq4 X-Rspamd-Queue-Id: 6A8BA160004 X-HE-Tag: 1675070685-924247 X-HE-Meta: U2FsdGVkX18v8Y3WOMWuDrK5cE8FDjWaPjaaRKMUAIBUcgXRWZHqfwSz42wGeDbEdEOPzqOdpzc+w51rOQEw2/AeVQstbSL25QrnkI0YBdzUXjqSes33SgD1W/1X2YUHpmCRfdQY8JvqLoGCyUmNLEBjbT+3SqRPP+Vmiku2tAOBjKR34jE1J4hKu6ufH9pkj9t92bINznWl5J+VDcxnZAPVVYSEQQgdivk1oH7ZPK18rhqLar5n3sWhG0YK7EZfpq32D0lq2ZiQX9f/rHB2GiO1argmKn6MmmQczqrLl45CkZeFkOeiMhHphdT1/0pxlgQxvaDSPHWcHYsh4rDJV65D8pM2ayYhlqaKAkTmOMz5qGiJhduS9vLx0tO/spY3ANpfaOUW+Km8TIUvBRXNPM7sqzEo8KVf5Xh0X0PPg3M32O6K/fAuylDp67gK8KhQ2HaXM+kO5F2RoazIBP9Qlx6Ot4NhmzFihL2NGG4k+kaOcUNRhLsndLkGTBXpbr3pLfQsEQ9Ho7lob6F4drpx5TzP1wCsW+MovxZf08QmbVFYFsNCdaLZ7cJ9E32WuEhL16jKOG+G+uJlKPfzsMAel4/oi2NVw+X1QP7KyNUERBeWk3LiSAuXiylXOxBepeR2ywJ3yue6qisvPBO5mtfQIULrsCUnBMrmbHOOFRxI555LkSE+/c/UHX2FdUi455qkGAPUiZvVsug+7C+fCu6S+/CZVdNnXpDIasc2DPm99bEzcr9aCPMvUiBsgQy3xrf9pu4GJREwU4EqJlMiFhMJDfDp5iNRnWi82W/RfN8GekDF86S2rNxkZGBArSzJgtOQ5Y2C+jMAGDDyDEvQ3Dp+PuAyjmOQHE1RE5+F7fswAnUqvnHZMLdg+jHCKYTWP4OjM1SzcYjb/3sxs8qvoiVEb/e84qA0mZS84u94ggvrC0sY2lhAiGPzExhjB0BzgUh316z3cX5ioL95M4NH4vG G7HgVCQ4 d6VNhcalfxDOXdmO02vrwMuyIDGIMTtb8tRYZznmuvoMlH0HqgzPy206maejksJqX0WZXhGBxX1C4RObGi7hb/3N443VD6PF1XJVzfPhflIn6J6m9P/J6wvgWxJxy9Ukspah2PKN9EFejCAZsnmngUv+r5uGY5Oj7UqnnNPe+KCY7jSPrcBkwKoaYyk5XyKMRdpaZ3K3L8v1IHVCV8By7toSJV1bztb8E8IiG+QNtDkAPvI39cISrZUnECzYMgjZdZi++y75g1yMWaKBEXdLwXwCvyKHdk/73yx7RBPzNrRogmCiWU0WNoAX+06B5HykxM+zJjBmtGZOzigCx5ieniFPLwKFBAbpAXEstxF0yP0JGDIvogKtb/oS8yeRxm6+XFxdfW8BWdTgcWRMInL8bbt9V52hB4W35Hy0Wpn2O9dfkO6gcVZG1Qvf/h9oGxeTisq7IX2GEV7X4ZnuKyY3PREo9p/cYiFPALpWI4ZmA8WaLHjnmkcUUPHdWZQ== 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: Use the bvec_set_page helper to initialize a bvec. Signed-off-by: Christoph Hellwig --- fs/coredump.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/coredump.c b/fs/coredump.c index de78bde2991beb..0a6873a9c4d0cd 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -840,11 +840,7 @@ static int __dump_skip(struct coredump_params *cprm, size_t nr) static int dump_emit_page(struct coredump_params *cprm, struct page *page) { - struct bio_vec bvec = { - .bv_page = page, - .bv_offset = 0, - .bv_len = PAGE_SIZE, - }; + struct bio_vec bvec; struct iov_iter iter; struct file *file = cprm->file; loff_t pos; @@ -860,6 +856,7 @@ static int dump_emit_page(struct coredump_params *cprm, struct page *page) if (dump_interrupted()) return 0; pos = file->f_pos; + bvec_set_page(&bvec, page, PAGE_SIZE, 0); iov_iter_bvec(&iter, ITER_SOURCE, &bvec, 1, PAGE_SIZE); n = __kernel_write_iter(cprm->file, &iter, &pos); if (n != PAGE_SIZE)