Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216362/?format=api
{ "id": 2216362, "url": "http://patchwork.ozlabs.org/api/patches/2216362/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260326104544.509518-17-dhowells@redhat.com/", "project": { "id": 12, "url": "http://patchwork.ozlabs.org/api/projects/12/?format=api", "name": "Linux CIFS Client", "link_name": "linux-cifs-client", "list_id": "linux-cifs.vger.kernel.org", "list_email": "linux-cifs@vger.kernel.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260326104544.509518-17-dhowells@redhat.com>", "list_archive_url": null, "date": "2026-03-26T10:45:31", "name": "[16/26] cifs: Use a bvecq for buffering instead of a folioq", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "cb0f3996d40bb980fcb278f237a6faef40cd7ff9", "submitter": { "id": 59, "url": "http://patchwork.ozlabs.org/api/people/59/?format=api", "name": "David Howells", "email": "dhowells@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260326104544.509518-17-dhowells@redhat.com/mbox/", "series": [ { "id": 497565, "url": "http://patchwork.ozlabs.org/api/series/497565/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=497565", "date": "2026-03-26T10:45:15", "name": "netfs: Keep track of folios in a segmented bio_vec[] chain", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497565/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216362/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216362/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-cifs+bounces-10539-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linux-cifs@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=BM2bSMXn;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10539-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=\"BM2bSMXn\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=170.10.133.124", "smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=redhat.com" ], "Received": [ "from sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fhLcZ02vrz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 22:08:46 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id C968E300AD8B\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 10:52:35 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 482703F077F;\n\tThu, 26 Mar 2026 10:48:37 +0000 (UTC)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id E21B03EF670\n\tfor <linux-cifs@vger.kernel.org>; Thu, 26 Mar 2026 10:48:32 +0000 (UTC)", "from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-QPvdn8QEMauIEwF2aJ17cw-1; Thu,\n 26 Mar 2026 06:48:28 -0400", "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 672BD195609D;\n\tThu, 26 Mar 2026 10:48:25 +0000 (UTC)", "from warthog.procyon.org.com (unknown [10.44.33.121])\n\tby mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 9E77E1800673;\n\tThu, 26 Mar 2026 10:48:18 +0000 (UTC)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774522116; cv=none;\n b=RxehBEEPkbrBVku0MKYn3WzNYysRFpZcmu5UWBaWfQjTZXmDAPP3+f3otTM+jM450za1UQSK/+hpQqe8VHxSlm83WV5sZuLm50OM1DROg3wd1VAE5WhR0EGugw6Uo8JeSzEbCqv5fJJN83Tz7dENBVZ1CL0/lhMNfObxzwn1EMA=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774522116; c=relaxed/simple;\n\tbh=ZBF91+HpA9wgsul+yF7EeNsqtnIj9MKApc0uTHtyCw0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=gETXMcAPar5MCFif+sZ3rhZf+zYZnUt536er9QZ6Wvr+UJPI1E7t1y9X1qbVbjixzE2Idk4pUaUMyWQjy3fJ/ybZxNuJcgEnca7k6sRB5aUsI5xOgsrT33td6/KgmFRaxQKBqOIxNGza88xbO49StbfGyVjwFp61Ios/PxPMAuQ=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=redhat.com;\n spf=pass smtp.mailfrom=redhat.com;\n dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.b=BM2bSMXn; arc=none smtp.client-ip=170.10.133.124", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1774522111;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=krVmpP82y+QIFp7wo5qWjTSA/mWyNnX49/zPEYm0X7c=;\n\tb=BM2bSMXnJx+TQYyvLkMIn/2Gq4y7xf67bsr52Uevojf6UWo+J3NmkFJ00eyPS0YVXivVlz\n\tR2T7z9MIhvLzD1PM075A2kGuayw6qkUHVQunbQf+jvVDVg1inP17TmiQmiNgK7ewxIz/UD\n\tF9CJEPhAUCbqyGtBJ+RHwIeZT/s+9FM=", "X-MC-Unique": "QPvdn8QEMauIEwF2aJ17cw-1", "X-Mimecast-MFC-AGG-ID": "QPvdn8QEMauIEwF2aJ17cw_1774522105", "From": "David Howells <dhowells@redhat.com>", "To": "Christian Brauner <christian@brauner.io>,\n\tMatthew Wilcox <willy@infradead.org>,\n\tChristoph Hellwig <hch@infradead.org>", "Cc": "David Howells <dhowells@redhat.com>,\n\tPaulo Alcantara <pc@manguebit.com>,\n\tJens Axboe <axboe@kernel.dk>,\n\tLeon Romanovsky <leon@kernel.org>,\n\tSteve French <sfrench@samba.org>,\n\tChenXiaoSong <chenxiaosong@chenxiaosong.com>,\n\tMarc Dionne <marc.dionne@auristor.com>,\n\tEric Van Hensbergen <ericvh@kernel.org>,\n\tDominique Martinet <asmadeus@codewreck.org>,\n\tIlya Dryomov <idryomov@gmail.com>,\n\tTrond Myklebust <trondmy@kernel.org>,\n\tnetfs@lists.linux.dev,\n\tlinux-afs@lists.infradead.org,\n\tlinux-cifs@vger.kernel.org,\n\tlinux-nfs@vger.kernel.org,\n\tceph-devel@vger.kernel.org,\n\tv9fs@lists.linux.dev,\n\tlinux-erofs@lists.ozlabs.org,\n\tlinux-fsdevel@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tPaulo Alcantara <pc@manguebit.org>", "Subject": "[PATCH 16/26] cifs: Use a bvecq for buffering instead of a folioq", "Date": "Thu, 26 Mar 2026 10:45:31 +0000", "Message-ID": "<20260326104544.509518-17-dhowells@redhat.com>", "In-Reply-To": "<20260326104544.509518-1-dhowells@redhat.com>", "References": "<20260326104544.509518-1-dhowells@redhat.com>", "Precedence": "bulk", "X-Mailing-List": "linux-cifs@vger.kernel.org", "List-Id": "<linux-cifs.vger.kernel.org>", "List-Subscribe": "<mailto:linux-cifs+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:linux-cifs+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93" }, "content": "Use a bvecq for internal buffering for crypto purposes instead of a folioq\nso that the latter can be phased out.\n\nSigned-off-by: David Howells <dhowells@redhat.com>\ncc: Paulo Alcantara <pc@manguebit.org>\ncc: Matthew Wilcox <willy@infradead.org>\ncc: Christoph Hellwig <hch@infradead.org>\ncc: Steve French <sfrench@samba.org>\ncc: linux-cifs@vger.kernel.org\ncc: netfs@lists.linux.dev\ncc: linux-fsdevel@vger.kernel.org\n---\n fs/smb/client/cifsglob.h | 2 +-\n fs/smb/client/smb2ops.c | 70 +++++++++++++++++++---------------------\n 2 files changed, 34 insertions(+), 38 deletions(-)", "diff": "diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h\nindex 6f9b6c72962b..8f3c16b57a1f 100644\n--- a/fs/smb/client/cifsglob.h\n+++ b/fs/smb/client/cifsglob.h\n@@ -290,7 +290,7 @@ struct smb_rqst {\n \tstruct kvec\t*rq_iov;\t/* array of kvecs */\n \tunsigned int\trq_nvec;\t/* number of kvecs in array */\n \tstruct iov_iter\trq_iter;\t/* Data iterator */\n-\tstruct folio_queue *rq_buffer;\t/* Buffer for encryption */\n+\tstruct bvecq\t*rq_buffer;\t/* Buffer for encryption */\n };\n \n struct mid_q_entry;\ndiff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c\nindex 7f2d3459cbf9..173acca17af7 100644\n--- a/fs/smb/client/smb2ops.c\n+++ b/fs/smb/client/smb2ops.c\n@@ -4517,19 +4517,17 @@ crypt_message(struct TCP_Server_Info *server, int num_rqst,\n }\n \n /*\n- * Copy data from an iterator to the folios in a folio queue buffer.\n+ * Copy data from an iterator to the pages in a bvec queue buffer.\n */\n-static bool cifs_copy_iter_to_folioq(struct iov_iter *iter, size_t size,\n-\t\t\t\t struct folio_queue *buffer)\n+static bool cifs_copy_iter_to_bvecq(struct iov_iter *iter, size_t size,\n+\t\t\t\t struct bvecq *buffer)\n {\n \tfor (; buffer; buffer = buffer->next) {\n-\t\tfor (int s = 0; s < folioq_count(buffer); s++) {\n-\t\t\tstruct folio *folio = folioq_folio(buffer, s);\n-\t\t\tsize_t part = folioq_folio_size(buffer, s);\n+\t\tfor (int s = 0; s < buffer->nr_slots; s++) {\n+\t\t\tstruct bio_vec *bv = &buffer->bv[s];\n+\t\t\tsize_t part = umin(bv->bv_len, size);\n \n-\t\t\tpart = umin(part, size);\n-\n-\t\t\tif (copy_folio_from_iter(folio, 0, part, iter) != part)\n+\t\t\tif (copy_page_from_iter(bv->bv_page, 0, part, iter) != part)\n \t\t\t\treturn false;\n \t\t\tsize -= part;\n \t\t}\n@@ -4541,7 +4539,7 @@ void\n smb3_free_compound_rqst(int num_rqst, struct smb_rqst *rqst)\n {\n \tfor (int i = 0; i < num_rqst; i++)\n-\t\tnetfs_free_folioq_buffer(rqst[i].rq_buffer);\n+\t\tbvecq_put(rqst[i].rq_buffer);\n }\n \n /*\n@@ -4568,7 +4566,7 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, int num_rqst,\n \tfor (int i = 1; i < num_rqst; i++) {\n \t\tstruct smb_rqst *old = &old_rq[i - 1];\n \t\tstruct smb_rqst *new = &new_rq[i];\n-\t\tstruct folio_queue *buffer = NULL;\n+\t\tstruct bvecq *buffer = NULL;\n \t\tsize_t size = iov_iter_count(&old->rq_iter);\n \n \t\torig_len += smb_rqst_len(server, old);\n@@ -4576,17 +4574,16 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, int num_rqst,\n \t\tnew->rq_nvec = old->rq_nvec;\n \n \t\tif (size > 0) {\n-\t\t\tsize_t cur_size = 0;\n-\t\t\trc = netfs_alloc_folioq_buffer(NULL, &buffer, &cur_size,\n-\t\t\t\t\t\t size, GFP_NOFS);\n-\t\t\tif (rc < 0)\n+\t\t\trc = -ENOMEM;\n+\t\t\tbuffer = bvecq_alloc_buffer(size, 0, GFP_NOFS);\n+\t\t\tif (!buffer)\n \t\t\t\tgoto err_free;\n \n \t\t\tnew->rq_buffer = buffer;\n-\t\t\tiov_iter_folio_queue(&new->rq_iter, ITER_SOURCE,\n-\t\t\t\t\t buffer, 0, 0, size);\n+\t\t\tiov_iter_bvec_queue(&new->rq_iter, ITER_SOURCE,\n+\t\t\t\t\t buffer, 0, 0, size);\n \n-\t\t\tif (!cifs_copy_iter_to_folioq(&old->rq_iter, size, buffer)) {\n+\t\t\tif (!cifs_copy_iter_to_bvecq(&old->rq_iter, size, buffer)) {\n \t\t\t\trc = smb_EIO1(smb_eio_trace_tx_copy_iter_to_buf, size);\n \t\t\t\tgoto err_free;\n \t\t\t}\n@@ -4676,16 +4673,15 @@ decrypt_raw_data(struct TCP_Server_Info *server, char *buf,\n }\n \n static int\n-cifs_copy_folioq_to_iter(struct folio_queue *folioq, size_t data_size,\n-\t\t\t size_t skip, struct iov_iter *iter)\n+cifs_copy_bvecq_to_iter(struct bvecq *bq, size_t data_size,\n+\t\t\tsize_t skip, struct iov_iter *iter)\n {\n-\tfor (; folioq; folioq = folioq->next) {\n-\t\tfor (int s = 0; s < folioq_count(folioq); s++) {\n-\t\t\tstruct folio *folio = folioq_folio(folioq, s);\n-\t\t\tsize_t fsize = folio_size(folio);\n-\t\t\tsize_t n, len = umin(fsize - skip, data_size);\n+\tfor (; bq; bq = bq->next) {\n+\t\tfor (int s = 0; s < bq->nr_slots; s++) {\n+\t\t\tstruct bio_vec *bv = &bq->bv[s];\n+\t\t\tsize_t n, len = umin(bv->bv_len - skip, data_size);\n \n-\t\t\tn = copy_folio_to_iter(folio, skip, len, iter);\n+\t\t\tn = copy_page_to_iter(bv->bv_page, bv->bv_offset + skip, len, iter);\n \t\t\tif (n != len) {\n \t\t\t\tcifs_dbg(VFS, \"%s: something went wrong\\n\", __func__);\n \t\t\t\treturn smb_EIO2(smb_eio_trace_rx_copy_to_iter,\n@@ -4701,7 +4697,7 @@ cifs_copy_folioq_to_iter(struct folio_queue *folioq, size_t data_size,\n \n static int\n handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid,\n-\t\t char *buf, unsigned int buf_len, struct folio_queue *buffer,\n+\t\t char *buf, unsigned int buf_len, struct bvecq *buffer,\n \t\t unsigned int buffer_len, bool is_offloaded)\n {\n \tunsigned int data_offset;\n@@ -4810,8 +4806,8 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid,\n \t\t}\n \n \t\t/* Copy the data to the output I/O iterator. */\n-\t\trdata->result = cifs_copy_folioq_to_iter(buffer, buffer_len,\n-\t\t\t\t\t\t\t cur_off, &rdata->subreq.io_iter);\n+\t\trdata->result = cifs_copy_bvecq_to_iter(buffer, buffer_len,\n+\t\t\t\t\t\t\tcur_off, &rdata->subreq.io_iter);\n \t\tif (rdata->result != 0) {\n \t\t\tif (is_offloaded)\n \t\t\t\tmid->mid_state = MID_RESPONSE_MALFORMED;\n@@ -4849,7 +4845,7 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid,\n struct smb2_decrypt_work {\n \tstruct work_struct decrypt;\n \tstruct TCP_Server_Info *server;\n-\tstruct folio_queue *buffer;\n+\tstruct bvecq *buffer;\n \tchar *buf;\n \tunsigned int len;\n };\n@@ -4863,7 +4859,7 @@ static void smb2_decrypt_offload(struct work_struct *work)\n \tstruct mid_q_entry *mid;\n \tstruct iov_iter iter;\n \n-\tiov_iter_folio_queue(&iter, ITER_DEST, dw->buffer, 0, 0, dw->len);\n+\tiov_iter_bvec_queue(&iter, ITER_DEST, dw->buffer, 0, 0, dw->len);\n \trc = decrypt_raw_data(dw->server, dw->buf, dw->server->vals->read_rsp_size,\n \t\t\t &iter, true);\n \tif (rc) {\n@@ -4912,7 +4908,7 @@ static void smb2_decrypt_offload(struct work_struct *work)\n \t}\n \n free_pages:\n-\tnetfs_free_folioq_buffer(dw->buffer);\n+\tbvecq_put(dw->buffer);\n \tcifs_small_buf_release(dw->buf);\n \tkfree(dw);\n }\n@@ -4950,12 +4946,12 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid,\n \tdw->len = len;\n \tlen = round_up(dw->len, PAGE_SIZE);\n \n-\tsize_t cur_size = 0;\n-\trc = netfs_alloc_folioq_buffer(NULL, &dw->buffer, &cur_size, len, GFP_NOFS);\n-\tif (rc < 0)\n+\trc = -ENOMEM;\n+\tdw->buffer = bvecq_alloc_buffer(len, 0, GFP_NOFS);\n+\tif (!dw->buffer)\n \t\tgoto discard_data;\n \n-\tiov_iter_folio_queue(&iter, ITER_DEST, dw->buffer, 0, 0, len);\n+\tiov_iter_bvec_queue(&iter, ITER_DEST, dw->buffer, 0, 0, len);\n \n \t/* Read the data into the buffer and clear excess bufferage. */\n \trc = cifs_read_iter_from_socket(server, &iter, dw->len);\n@@ -5013,7 +5009,7 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid,\n \t}\n \n free_pages:\n-\tnetfs_free_folioq_buffer(dw->buffer);\n+\tbvecq_put(dw->buffer);\n free_dw:\n \tkfree(dw);\n \treturn rc;\n", "prefixes": [ "16/26" ] }