From patchwork Fri Feb 3 15:06:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13127852 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 40833C6FA95 for ; Fri, 3 Feb 2023 15:08:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20C2A6B0088; Fri, 3 Feb 2023 10:08:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 16F076B0089; Fri, 3 Feb 2023 10:08:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB8FD6B008C; Fri, 3 Feb 2023 10:08:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C616D6B0089 for ; Fri, 3 Feb 2023 10:08:16 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A45D24115F for ; Fri, 3 Feb 2023 15:08:16 +0000 (UTC) X-FDA: 80426311392.21.F303CE0 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf26.hostedemail.com (Postfix) with ESMTP id E52CA14002B for ; Fri, 3 Feb 2023 15:08:14 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=30k+iDgn; dmarc=none; spf=none (imf26.hostedemail.com: domain of BATV+416129e804eec9e75a33+7103+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+416129e804eec9e75a33+7103+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675436895; 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=KsGLGG8P0njQRTI5ivStV/HD4PCoK7HqOUKYETPOUlmCN9dk525/L6ncCZy2WQvNpSey4Z hPgkFD2YsAQZUEYxU/gP327XhjCxzNFS+Pn+wZkm7PYwHSWC7muz/ohB4I77E8bI82l6D/ bS4yHv3ifv02eYo6ktdWc4mKE5g6Y9E= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=30k+iDgn; dmarc=none; spf=none (imf26.hostedemail.com: domain of BATV+416129e804eec9e75a33+7103+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+416129e804eec9e75a33+7103+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675436895; a=rsa-sha256; cv=none; b=Zn4WIhOcSISTXXKCf9tdY6E2CwNiuvuQcEDfcs7oTUcMEJZ1+/L7wwzVc1B3dkhSMmU6Hh CahTSun1r0EV54xiKOivPxrkyIy3/uWc1BAEn42N9hZ2gUy5CqsbPh7lpYf6N20tif8/3c o1/M+zd2jjiAelPyC11j1eYxDwa65I8= 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=30k+iDgncAPWoIs1asbdJ9AypT pITGuCJcL7UjH77N0dHLrWCTR4iipsDLVSW1QkzBjl3E2+n1+Xe4dpJ+eb12NdzBrOfqIv3wyv73u 0B5GW0AkghrWW2KBjdcpriHbaq67fty0PDv5EFHX1PNPyTXgz54iiBjDGBvM6y6LkzWeilykH2Oee NaDGnsn4CsqXIde+48ZnjSRU7C6ug5s0+Gn27MqKY0Us8YXKsPBEPH+CPwhJFQTz+s60KM0HlDquy RajcB2tsdJjsrHGRty4MY961bDPOHyuiO74hKxUINUfu4DP1ybIQAYnV766eoXhGVLyK/brlG2Q0D dPD5YyZw==; Received: from [2001:4bb8:19a:272a:910:bb67:7287:f956] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNxeu-002b0b-M3; Fri, 03 Feb 2023 15:07:25 +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: Fri, 3 Feb 2023 16:06:25 +0100 Message-Id: <20230203150634.3199647-15-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230203150634.3199647-1-hch@lst.de> References: <20230203150634.3199647-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: rspam02 X-Rspamd-Queue-Id: E52CA14002B X-Stat-Signature: qd1i9ymk7s5ww6qttzhgwnzi883jkes5 X-HE-Tag: 1675436894-690864 X-HE-Meta: U2FsdGVkX1/zY+ZQ2b9PWUescrIJuVls0buijU8pZT4FEbIWt97oJshM4g+1OqiLiB54bc2sJzF1Lu0nqGXVI3dKp1GF+LUyd48w+OOY4jMIt4fYmhHP8QlFAG1mhJkWw/ZxJctRhyrEbkKcRsmRs5UA+NVQADUYkt6d8WVIBjzE/HVJ8jwLboM7UGpmSWyPGYAIXb8bm59GXU6sW/+wXDliCSReWrJE6z2Bq62WhVObI6s6w+zVSw4EDOKIUqiCBhUbhQe8VhffBYp2QNQgLv/buHBTsRPnDlaM2Qq3jwRzF6TqTd5cvu2sOaZXXdSrrCQHyA8Q8H7wB8gfjajZWsWjcxEnmb8WiQ/dXKobLb2PywlyUznTb/6Fb1v8DuHMAa+dOAh1n5A5Y0YsyNr2oAr5UP42LMyr0dxrNkh59unEj8k09052jXdiJDnl7Mp89zDZXo3gFOjEsjjxkkVGdfjVSJGluAO7LVggRJg5CD8VVhx02ZWk8oK9mrzbFyQeiyNmpjl5AAyIhve+DNTGa62iWg5h1IQBX8hd4yvjMbxUGzJ0IPKJQjwYIXYywYkkKZaY/4hfS2eZ8M5TYcJpjQ375uw1WsQncb/0QwmV/870o/b/gLB7Xf0/Gy9nUsUn44QXv2+3sJAjHcHpdSCA/URTK2+2e/3+okZ76/tWnkwZM5ycuxSdD5Y2PlLaUQo49ndKfWvOGHOvV2+WP055RI7l0NmSuCILKKJa/1mQphpXv984ub/A4sewIz0hpUh6UgRDXd2ppr4uerpkAZEO4bGR1CcSF7cg4X17ncFRj1ZwdMaE5L4CvfAjCfV0Z7wfXeoOh2jJbe7iioKKlzpZ0alKB8BKImRMLoWhFeuQ7UOx81DJ4T0zPncezXOHDIdywb8ti0/cLn42rRaKDGtGyZDcubh51PiQklV/RvzbiLDMXOVmDPu6bHbbwyoLzPcJ1joQJ0Eo9hBKhJkJ/4L uxqpXOdK wIMNZhw0q15Yt97harHJCFHs8z7uXq4W7UKQ7b1VS2v0Fq1yjpYVIncK9t0dwFE1HCQg4X9cMvgyFqC9R6835Pz0PXAV6uaX2BwHDHBNimqgcbfoV0fq+55ZpBN+t06xn8MozlvU0RZzQk2OfmxmJkC+Sk6gYCsQbKMpa0rDXshLld7TNNQiCWE7JMEW2WR9gMQw7WdEtLuVp3imM0FsIWF6O+D0XMBMEe3mlRg51zIK2GYScuTTPnYeTE+/R2yX6FNtSN8ZKYaxDPf8o0KXstOJz80OF/NX7r022JQHa+RCD5+YA5bOKrjTPpTMSzTttH9VYCjIWYOXjDxwrIXwaXZFFGSwJJ6IrOiNkgk5DdPJ/tYZuE+bRhREXj3bMFeZQPT+83f8IQFSk84VqL0/5XFPkumMPg4ucBVlXGp8eTEIyhXE6NBf8GsQf2PJ6TH7ncQwMHFjDvzwKWJ64dn+0s+zlyxf0iUO7oQvJ 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)