get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2216354/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2216354,
    "url": "http://patchwork.ozlabs.org/api/patches/2216354/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260326104544.509518-15-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-15-dhowells@redhat.com>",
    "list_archive_url": null,
    "date": "2026-03-26T10:45:29",
    "name": "[14/26] netfs: Add a function to extract from an iter into a bvecq",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "428432c77dd1d0ea5d0c50c3abb339bc0af084d8",
    "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-15-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/2216354/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216354/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-10537-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=WAbNxJO3;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10537-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=\"WAbNxJO3\"",
            "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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fhLTk3XXmz1yGD\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 22:02:50 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 7855E30387CD\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 10:52:04 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7311D3EDAC0;\n\tThu, 26 Mar 2026 10:48:19 +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 049613ED5BA\n\tfor <linux-cifs@vger.kernel.org>; Thu, 26 Mar 2026 10:48:17 +0000 (UTC)",
            "from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-H2PjY8ChMyuS7rT40AhezQ-1; Thu,\n 26 Mar 2026 06:48:11 -0400",
            "from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id E6D89180034E;\n\tThu, 26 Mar 2026 10:48:08 +0000 (UTC)",
            "from warthog.procyon.org.com (unknown [10.44.33.121])\n\tby mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 783F11955F25;\n\tThu, 26 Mar 2026 10:48:02 +0000 (UTC)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774522099; cv=none;\n b=uiVtS/jinv83lKWPshcgBQ1zvLHCYBw8HmzI6k54l/hicY4T2n4EPzbLjie+LbgXy549PHkvuizcl1wTZ8UsPvkJzuIoDAyI/607MiILdRkHkhW82AQUvzJAn+57istuX//aalr9gjel0MnrTiKAudqLspScXlPmbUblMkeDcpI=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774522099; c=relaxed/simple;\n\tbh=MTxqkqINhnmFwsYY0I5RGkHMRfSTiKvm3IE0AehnxE0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=h0NjSvDpAPFI+krLV/BioSJOlZDLmkIHjOLxi4DWVj9sgkcHLkzZOU0XNPqxPt/jLSDYNWNnmyRM9t+6WWECxgZ1N3E5Xx2HNNmBeJa0LfOMVCxB3LHFnv/vYiO+0AfYES9DSP7s3BsqH8jGac4hKf2og6HYZtE0szb1mOqAios=",
        "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=WAbNxJO3; 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=1774522097;\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=0q3CSNpbXi5lOGrcvXbX8mvLw/thJvXIjpsnNa/bq6w=;\n\tb=WAbNxJO3+fDs6ENOQ/kFy8DKGJLE1egWtnBVFLd/d1P804m7OFZELwmXKTzn33ubQEboHi\n\tnGQ224sgUArJr54gEegNmkOiuGacls3a2pRUru3plmJYBMxpCBKqkPIMKfGLh+TCd26T6t\n\tslh1+J+CjbCCbBLrtyiemnOQYNRyG8M=",
        "X-MC-Unique": "H2PjY8ChMyuS7rT40AhezQ-1",
        "X-Mimecast-MFC-AGG-ID": "H2PjY8ChMyuS7rT40AhezQ_1774522089",
        "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 14/26] netfs: Add a function to extract from an iter into a\n bvecq",
        "Date": "Thu, 26 Mar 2026 10:45:29 +0000",
        "Message-ID": "<20260326104544.509518-15-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.0 on 10.30.177.12"
    },
    "content": "Add a function to extract a slice of data from an iterator of any type into\na bvec queue chain.\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/netfs/iterator.c   | 123 ++++++++++++++++++++++++++++++++++++++++++\n include/linux/netfs.h |   3 ++\n 2 files changed, 126 insertions(+)",
    "diff": "diff --git a/fs/netfs/iterator.c b/fs/netfs/iterator.c\nindex adca78747f23..e77fd39327c2 100644\n--- a/fs/netfs/iterator.c\n+++ b/fs/netfs/iterator.c\n@@ -13,6 +13,129 @@\n #include <linux/netfs.h>\n #include \"internal.h\"\n \n+/**\n+ * netfs_extract_iter - Extract the pages from an iterator into a bvecq\n+ * @orig: The original iterator\n+ * @orig_len: The amount of iterator to copy\n+ * @max_segs: Maximum number of contiguous segments\n+ * @fpos: Starting file position to label the bvecq with\n+ * @_bvecq_head: Where to cache the bvec queue\n+ * @extraction_flags: Flags to qualify the request\n+ *\n+ * Extract the page fragments from the given amount of the source iterator and\n+ * build bvec queue that refers to all of those bits.  This allows the original\n+ * iterator to disposed of.\n+ *\n+ * @extraction_flags can have ITER_ALLOW_P2PDMA set to request peer-to-peer DMA be\n+ * allowed on the pages extracted.\n+ *\n+ * On success, the amount of data in the bvec is returned, the original\n+ * iterator will have been advanced by the amount extracted.\n+ *\n+ * The bvecq segments are marked with indications on how to get clean up the\n+ * extracted fragments.\n+ */\n+ssize_t netfs_extract_iter(struct iov_iter *orig, size_t orig_len, size_t max_segs,\n+\t\t\t   unsigned long long fpos, struct bvecq **_bvecq_head,\n+\t\t\t   iov_iter_extraction_t extraction_flags)\n+{\n+\tstruct bvecq *bq_tail = NULL;\n+\tssize_t ret = 0;\n+\tsize_t extracted = 0, nr_pages;\n+\n+\t_enter(\"{%u,%zx},%zx\", orig->iter_type, orig->count, orig_len);\n+\n+\tWARN_ON_ONCE(orig_len > orig->count);\n+\n+\tnr_pages = iov_iter_npages(orig, max_segs ?: INT_MAX);\n+\tif (WARN_ON(nr_pages == 0) ||\n+\t    WARN_ON(nr_pages > max_segs))\n+\t\tnr_pages = max_segs;\n+\tmax_segs = nr_pages;\n+\n+\tdo {\n+\t\tstruct bvecq *bq;\n+\n+\t\tif (WARN_ON(max_segs == 0))\n+\t\t\tbreak;\n+\n+\t\tbq = bvecq_alloc_one(max_segs, GFP_NOFS);\n+\t\tif (!bq) {\n+\t\t\tret = -ENOMEM;\n+\t\t\tbreak;\n+\t\t}\n+\t\tbq->free\t= user_backed_iter(orig);\n+\t\tbq->unpin\t= iov_iter_extract_will_pin(orig);\n+\t\tbq->prev\t= bq_tail;\n+\t\tbq->fpos\t= fpos + extracted;\n+\n+\t\tif (bq_tail)\n+\t\t\tbq_tail->next = bq;\n+\t\telse\n+\t\t\t*_bvecq_head = bq;\n+\t\tbq_tail = bq;\n+\n+\t\tif (orig_len == 0)\n+\t\t\tbreak;\n+\n+\t\tstruct bio_vec *bv = bq->bv;\n+\t\tdo {\n+\t\t\tstruct page **pages;\n+\t\t\tssize_t got;\n+\t\t\tsize_t offset;\n+\t\t\tsize_t space = bq->max_slots - bq->nr_slots;\n+\t\t\tsize_t bv_size = array_size(bq->max_slots, sizeof(*bv));\n+\t\t\tsize_t pg_size = array_size(space, sizeof(*pages));\n+\n+\t\t\t/* Put the page list at the end of the bvec list\n+\t\t\t * storage.  bvec elements are larger than page\n+\t\t\t * pointers, so as long as we work 0->last, we should\n+\t\t\t * be fine.\n+\t\t\t */\n+\t\t\tpages = (void *)bv + bv_size - pg_size;\n+\n+\t\t\tgot = iov_iter_extract_pages(orig, &pages, orig_len,\n+\t\t\t\t\t\t     space, extraction_flags, &offset);\n+\t\t\tif (got < 0) {\n+\t\t\t\tret = got;\n+\t\t\t\tgoto out;\n+\t\t\t}\n+\n+\t\t\tif (got == 0) {\n+\t\t\t\tpr_err(\"extract_pages gave nothing from %zu, %zu\\n\",\n+\t\t\t\t       extracted, orig_len);\n+\t\t\t\tret = -EIO;\n+\t\t\t\tgoto out;\n+\t\t\t}\n+\n+\t\t\tif (got > orig_len - extracted) {\n+\t\t\t\tpr_err(\"extract_pages rc=%zd more than %zu\\n\",\n+\t\t\t\t       got, orig_len);\n+\t\t\t\tgoto out;\n+\t\t\t}\n+\n+\t\t\textracted += got;\n+\t\t\torig_len -= got;\n+\n+\t\t\tdo {\n+\t\t\t\tsize_t len = umin(got, PAGE_SIZE - offset);\n+\n+\t\t\t\tBUG_ON(bq->nr_slots >= bq->max_slots);\n+\n+\t\t\t\tbvec_set_page(&bq->bv[bq->nr_slots],\n+\t\t\t\t\t      *pages++, len, offset);\n+\t\t\t\tbq->nr_slots++;\n+\t\t\t\tgot -= len;\n+\t\t\t\toffset = 0;\n+\t\t\t} while (got > 0);\n+\t\t} while (orig_len > 0 && !bvecq_is_full(bq));\n+\t} while (orig_len > 0 && max_segs > 0);\n+\n+out:\n+\treturn extracted ?: ret;\n+}\n+EXPORT_SYMBOL_GPL(netfs_extract_iter);\n+\n /**\n  * netfs_extract_user_iter - Extract the pages from a user iterator into a bvec\n  * @orig: The original iterator\ndiff --git a/include/linux/netfs.h b/include/linux/netfs.h\nindex 5bc48aacf7f6..b4602f7b6431 100644\n--- a/include/linux/netfs.h\n+++ b/include/linux/netfs.h\n@@ -445,6 +445,9 @@ void netfs_get_subrequest(struct netfs_io_subrequest *subreq,\n \t\t\t  enum netfs_sreq_ref_trace what);\n void netfs_put_subrequest(struct netfs_io_subrequest *subreq,\n \t\t\t  enum netfs_sreq_ref_trace what);\n+ssize_t netfs_extract_iter(struct iov_iter *orig, size_t orig_len, size_t max_segs,\n+\t\t\t   unsigned long long fpos, struct bvecq **_bvecq_head,\n+\t\t\t   iov_iter_extraction_t extraction_flags);\n ssize_t netfs_extract_user_iter(struct iov_iter *orig, size_t orig_len,\n \t\t\t\tstruct iov_iter *new,\n \t\t\t\tiov_iter_extraction_t extraction_flags);\n",
    "prefixes": [
        "14/26"
    ]
}