From patchwork Mon Jan 30 09:21:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120631 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 C7AD1C64ED9 for ; Mon, 30 Jan 2023 09:24:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B8476B0081; Mon, 30 Jan 2023 04:24:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EBC86B0082; Mon, 30 Jan 2023 04:24:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26B7A6B0081; Mon, 30 Jan 2023 04:24:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E54236B0075 for ; Mon, 30 Jan 2023 04:24:01 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C849B120941 for ; Mon, 30 Jan 2023 09:24:01 +0000 (UTC) X-FDA: 80410928682.12.42AE35B Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf06.hostedemail.com (Postfix) with ESMTP id 20F9A18001D for ; Mon, 30 Jan 2023 09:23:59 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=4BcbynZE; spf=temperror (imf06.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=1675070640; 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=YZUJ7HQihAVM9SQ7v6O493rk0LMuO0CwXzf/a69CjIo=; b=0idTlYjRYsZQ2VaYZnOtPZwwl0iZNgebjk1e9UddnDs7HUupjfytS7+MViNKiwJ5yGFb3j DaodCJCm4G8E0JaoMTnDJ8vhb2fXkS6B2XF4+bFQIcTfsJibx5rKaBJBsBxCOVHDthIAPT vbHdMGMJuep2XxA4pq1gdxFCnvVvaKw= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=4BcbynZE; spf=temperror (imf06.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=1675070640; a=rsa-sha256; cv=none; b=a9+K4uuYTWRrLOkGXpJh9Xc6pX8yBYTX1NsRA5PtjI/1WPmfRsdKW3HRJSZ8s97o17cmEs wI+51fE7ibORIOfvwEVv3V2OvO8gGkqKEIDx8p77nN/FHCByfXSKoLpr1IiB0XKNx2nN5t fDv90xAqtIUI36HG/nN70I5Sri8ibhA= 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=YZUJ7HQihAVM9SQ7v6O493rk0LMuO0CwXzf/a69CjIo=; b=4BcbynZET2dk93MnTnfUkrL330 nYKMZsmSMCXKbmb2MM3OP2QpdJU8eNF917CXS5pxtBLjTZMwQrKTtMnws2ohBA7RRWHec4I36770B Ox5+nkrXX9wj79Humb1i22F3sOfhx5Q0INe9jxIOGlDAhH7tSTgYpYPAdribUQEd61yXcFAkUZg7Y usvpEhVaXaFP0bU5cEO5OugHl76HEBC2sYb6BKn5vE9PSlk+fsVSQPb+uYmueklT/b2nfc8UWSSxN kiM0alrKzbROr8GBwV+vS9MFZZ4Cquq6oxKUN9fAM9wRzcs79/fw/ikKNhmMiAHMU8UjJ0DbCv4es UohtdqJA==; 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 1pMQMy-002o9A-P0; Mon, 30 Jan 2023 09:22:33 +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 09/23] virtio_blk: use bvec_set_virt to initialize special_vec Date: Mon, 30 Jan 2023 10:21:43 +0100 Message-Id: <20230130092157.1759539-10-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: rspam04 X-Rspamd-Queue-Id: 20F9A18001D X-Stat-Signature: bi8zn1t986nuh3a693rjnincjsgfg9zk X-HE-Tag: 1675070639-712079 X-HE-Meta: U2FsdGVkX1/gI4pWHjghMZ4XjWET394P0tw1II7eVZqeh1v33JzfVND7eXs41LE78gepKxWFySqoZNzss3ksKNioB+dNi4Vhhm01HFzu+riG5fU2tAN2y3Aezt4rr9iAD9lufCeUKyppAr48ATHm15sZdY1kr9dyGkyEEPqBSK+BrKkQUy9gq8UU2ZuzKHAjsOTU1uW8GV7KnkSs2w3rynnNBG4n7b6V3jVjodVkDu9bWkluPuUtas6e7aDa+vLmYVe8Pcmamie8MDV1v/21Q3JWPeP/9mdlmnRRttsYfoCkF4Nu82G+0Dt6e1toT8yaZUjwFpYZjUm+6JoTF7wbaPkccJHuHSmr7t1zmZC/zOC8zS2yD9iNoOOS1cjDPagesQZjuGF3UtaGBQfET0i2iv4h/eyA68/dIEi4T13zsBwufzqGhb/geefLlT2PdQg3Ll2Ma+XHI5F0Co/3eLDrLtB27zhGb8D8LvwX+Q++BnwnukGLBhpwH2Z82A36yJp4JGWRXOwkypSxCTDVCRlrHJ5ZJJEdbR593UQ14svMnh2wtrraQunCbFqwIPiQf/ekEbiItgRw6TLlj5ymLq7zn9n36+m5yyzCf4K9oSHqV00sfNmTCg6xMLcJYRXrwAgBCq6aFFOmusIfYBp0QHVXt/dcEoguK3KugQwOcK4cMr/oEolkGSRsc7J3HayYANyX3b3l6jjQI8ivO5SgU8wCNH7nbab2VDu19AO46BqVTxuvDs7NrUhFygVRcQwQxee3Xu24Hf5WfsuhnFTBQ6FwwH0LVgLsXarhJ0SGfCWdW+Df/PKofGo5yrtQd2gu5+0GdAcFtMtKWHuvkTnfdZtOAJ5vHn/DAO3m6xAJSyOvxWoMoNoHIk0u35RTURT6gKUeBp6Z4/tcm/vMbk4rEXbTy/BXqnkEmifkvSGG5tDUpr6LaqdFJEhQZdi4ShBsqcsfvjXm/1TkJtzbOX4Jejz 4DTEf0HS AiRlV6KTgGZbNHQ8/jzxgNqztOhPo/QBnEXV3q/UNGhRsDQK4vTuS2LeeNPYX3f1b16Y4ufpcVGYfzHz6NhBtA6BcleCR910eMz75+vPdJyjNEMUVeDni7Bgle027vsKe7RjDkKRn9bbGo+H5XkQvZJyrnL0XlCbGHRywSiiueknHaFrk9c0Q3rLfyyM1//o1VUtJUFt5jxfb/U2kwhNVgJtZc7CUYeCKy5WSCng2rpexdJFZnlJg8TPtupsCYf3asUlqsOC9qaDbZwOaOF9XHXNAF7KvXJ+Q5zo/biB2Xq1bgqtVnTovO7FOWFaeOG0VMvw7a5mtlJgvyQShpfFYbB5iBzz7C87/DH6WvMZBR9xW6XLx2gGMhS0DpbBWhFomzrP7dzmwqKEFta7cTWw54vqe77k0Hpg2cQ2KbvFTxEVbQEejeDDfqZ27+5A/x2ozKQcSP2SPHcKEJjiwmAjcR8iRnhAWVEavRevxX9ikvUKiHiY= 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_virt helper to initialize the special_vec. Signed-off-by: Christoph Hellwig Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Chaitanya Kulkarni --- drivers/block/virtio_blk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 6a77fa91742880..dc6e9b989910b0 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -170,9 +170,7 @@ static int virtblk_setup_discard_write_zeroes_erase(struct request *req, bool un WARN_ON_ONCE(n != segments); - req->special_vec.bv_page = virt_to_page(range); - req->special_vec.bv_offset = offset_in_page(range); - req->special_vec.bv_len = sizeof(*range) * segments; + bvec_set_virt(&req->special_vec, range, sizeof(*range) * segments); req->rq_flags |= RQF_SPECIAL_PAYLOAD; return 0;