get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216734,
    "url": "http://patchwork.ozlabs.org/api/patches/2216734/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-um/patch/20260327061704.3707577-23-hch@lst.de/",
    "project": {
        "id": 60,
        "url": "http://patchwork.ozlabs.org/api/projects/60/?format=api",
        "name": "User-mode Linux Development",
        "link_name": "linux-um",
        "list_id": "linux-um.lists.infradead.org",
        "list_email": "linux-um@lists.infradead.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260327061704.3707577-23-hch@lst.de>",
    "list_archive_url": null,
    "date": "2026-03-27T06:16:54",
    "name": "[22/28] xor: add a better public API",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "7fce0cd5a3a2d86aeffc05f8039761834f4b4c18",
    "submitter": {
        "id": 82,
        "url": "http://patchwork.ozlabs.org/api/people/82/?format=api",
        "name": "Christoph Hellwig",
        "email": "hch@lst.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-um/patch/20260327061704.3707577-23-hch@lst.de/mbox/",
    "series": [
        {
            "id": 497692,
            "url": "http://patchwork.ozlabs.org/api/series/497692/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-um/list/?series=497692",
            "date": "2026-03-27T06:16:33",
            "name": "[01/28] xor: assert that xor_blocks is not call from interrupt context",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497692/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216734/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216734/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=No7qioeh;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\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 4fhrCt6pb0z1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 17:22:34 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w60aX-00000006nhD-11yc;\n\tFri, 27 Mar 2026 06:22:33 +0000",
            "from\n 2a02-8389-2341-5b80-d601-7564-c2e0-491c.cable.dynamic.v6.surfer.at\n ([2a02:8389:2341:5b80:d601:7564:c2e0:491c] helo=localhost)\n\tby bombadil.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w60aT-00000006nXa-1A1l;\n\tFri, 27 Mar 2026 06:22:29 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help\n\t:List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding:\n\tMIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:\n\tReply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;\n\tbh=cXd+P/yafdPCZRxsWFTFtmngTaIOvIFzm+fNmrl5LSg=; b=No7qioehEHVKMubxyvRXnffzpm\n\tC+NyRn79bzUuOyboi6jW+kkCVjaPMtCN9x8SqBRjR8qKhXP1R/NWHUxR/ZRu0NZ9Psg1EdV9RvoSX\n\toHmHz9rSLGdBXB/K+uq3GxOpcSDI1bfjYMn8NSCQO860ADzdOYlF2fcnpE+JGlHTiclKhZKc0ya16\n\trTZbyC9hg6/7vZvZiA7NqG/5d+kcUp1hDDaF27gxyW7QgygkfwKj+mDsheXjQn4a21TS8Um5oDkTF\n\tHUxKhJ/059onnRZ174VtvhuXxeflt/EJnjH961Kz/C3nbit9Px/9xTfhXXaYY7+wN+5Xqx6Kcbc5s\n\tjnQ2ymNg==;",
        "From": "Christoph Hellwig <hch@lst.de>",
        "To": "Andrew Morton <akpm@linux-foundation.org>",
        "Cc": "Richard Henderson <richard.henderson@linaro.org>,\n\tMatt Turner <mattst88@gmail.com>,\n\tMagnus Lindholm <linmag7@gmail.com>,\n\tRussell King <linux@armlinux.org.uk>,\n\tCatalin Marinas <catalin.marinas@arm.com>,\n\tWill Deacon <will@kernel.org>,\n\tArd Biesheuvel <ardb@kernel.org>,\n\tHuacai Chen <chenhuacai@kernel.org>,\n\tWANG Xuerui <kernel@xen0n.name>,\n\tMadhavan Srinivasan <maddy@linux.ibm.com>,\n\tMichael Ellerman <mpe@ellerman.id.au>,\n\tNicholas Piggin <npiggin@gmail.com>,\n\t\"Christophe Leroy (CS GROUP)\" <chleroy@kernel.org>,\n\tPaul Walmsley <pjw@kernel.org>,\n\tPalmer Dabbelt <palmer@dabbelt.com>,\n\tAlbert Ou <aou@eecs.berkeley.edu>,\n\tAlexandre Ghiti <alex@ghiti.fr>,\n\tHeiko Carstens <hca@linux.ibm.com>,\n\tVasily Gorbik <gor@linux.ibm.com>,\n\tAlexander Gordeev <agordeev@linux.ibm.com>,\n\tChristian Borntraeger <borntraeger@linux.ibm.com>,\n\tSven Schnelle <svens@linux.ibm.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tAndreas Larsson <andreas@gaisler.com>,\n\tRichard Weinberger <richard@nod.at>,\n\tAnton Ivanov <anton.ivanov@cambridgegreys.com>,\n\tJohannes Berg <johannes@sipsolutions.net>,\n\tThomas Gleixner <tglx@kernel.org>,\n\tIngo Molnar <mingo@redhat.com>,\n\tBorislav Petkov <bp@alien8.de>,\n\tDave Hansen <dave.hansen@linux.intel.com>,\n\tx86@kernel.org,\n\t\"H. Peter Anvin\" <hpa@zytor.com>,\n\tHerbert Xu <herbert@gondor.apana.org.au>,\n\tDan Williams <dan.j.williams@intel.com>,\n\tChris Mason <clm@fb.com>,\n\tDavid Sterba <dsterba@suse.com>,\n\tArnd Bergmann <arnd@arndb.de>,\n\tSong Liu <song@kernel.org>,\n\tYu Kuai <yukuai@fnnas.com>,\n\tLi Nan <linan122@huawei.com>,\n\t\"Theodore Ts'o\" <tytso@mit.edu>,\n\t\"Jason A. Donenfeld\" <Jason@zx2c4.com>,\n\tlinux-alpha@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-arm-kernel@lists.infradead.org,\n\tloongarch@lists.linux.dev,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-riscv@lists.infradead.org,\n\tlinux-s390@vger.kernel.org,\n\tsparclinux@vger.kernel.org,\n\tlinux-um@lists.infradead.org,\n\tlinux-crypto@vger.kernel.org,\n\tlinux-btrfs@vger.kernel.org,\n\tlinux-arch@vger.kernel.org,\n\tlinux-raid@vger.kernel.org",
        "Subject": "[PATCH 22/28] xor: add a better public API",
        "Date": "Fri, 27 Mar 2026 07:16:54 +0100",
        "Message-ID": "<20260327061704.3707577-23-hch@lst.de>",
        "X-Mailer": "git-send-email 2.47.3",
        "In-Reply-To": "<20260327061704.3707577-1-hch@lst.de>",
        "References": "<20260327061704.3707577-1-hch@lst.de>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "linux-um@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<linux-um.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-um/>",
        "List-Post": "<mailto:linux-um@lists.infradead.org>",
        "List-Help": "<mailto:linux-um-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-um>,\n <mailto:linux-um-request@lists.infradead.org?subject=subscribe>",
        "Sender": "\"linux-um\" <linux-um-bounces@lists.infradead.org>",
        "Errors-To": "linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "xor_blocks is very annoying to use, because it is limited to 4 + 1\nsources / destinations, has an odd argument order and is completely\nundocumented.\n\nLift the code that loops around it from btrfs and async_tx/async_xor into\ncommon code under the name xor_gen and properly document it.\n\nSigned-off-by: Christoph Hellwig <hch@lst.de>\n---\n include/linux/raid/xor.h |  2 ++\n lib/raid/xor/xor-core.c  | 32 ++++++++++++++++++++++++++++++++\n 2 files changed, 34 insertions(+)",
    "diff": "diff --git a/include/linux/raid/xor.h b/include/linux/raid/xor.h\nindex 02bda8d99534..6d9a39fd85dd 100644\n--- a/include/linux/raid/xor.h\n+++ b/include/linux/raid/xor.h\n@@ -7,4 +7,6 @@\n extern void xor_blocks(unsigned int count, unsigned int bytes,\n \tvoid *dest, void **srcs);\n \n+void xor_gen(void *dest, void **srcs, unsigned int src_cnt, unsigned int bytes);\n+\n #endif /* _XOR_H */\ndiff --git a/lib/raid/xor/xor-core.c b/lib/raid/xor/xor-core.c\nindex de1d2899490a..07e06db32731 100644\n--- a/lib/raid/xor/xor-core.c\n+++ b/lib/raid/xor/xor-core.c\n@@ -46,6 +46,38 @@ xor_blocks(unsigned int src_count, unsigned int bytes, void *dest, void **srcs)\n }\n EXPORT_SYMBOL(xor_blocks);\n \n+/**\n+ * xor_gen - generate RAID-style XOR information\n+ * @dest:\tdestination vector\n+ * @srcs:\tsource vectors\n+ * @src_cnt:\tnumber of source vectors\n+ * @bytes:\tlength in bytes of each vector\n+ *\n+ * Performs bit-wise XOR operation into @dest for each of the @src_cnt vectors\n+ * in @srcs for a length of @bytes bytes.  @src_cnt must be non-zero, and the\n+ * memory pointed to by @dest and each member of @srcs must be at least 64-byte\n+ * aligned.  @bytes must be non-zero and a multiple of 512.\n+ *\n+ * Note: for typical RAID uses, @dest either needs to be zeroed, or filled with\n+ * the first disk, which then needs to be removed from @srcs.\n+ */\n+void xor_gen(void *dest, void **srcs, unsigned int src_cnt, unsigned int bytes)\n+{\n+\tunsigned int src_off = 0;\n+\n+\tWARN_ON_ONCE(bytes & 511);\n+\n+\twhile (src_cnt > 0) {\n+\t\tunsigned int this_cnt = min(src_cnt, MAX_XOR_BLOCKS);\n+\n+\t\txor_blocks(this_cnt, bytes, dest, srcs + src_off);\n+\n+\t\tsrc_cnt -= this_cnt;\n+\t\tsrc_off += this_cnt;\n+\t}\n+}\n+EXPORT_SYMBOL(xor_gen);\n+\n /* Set of all registered templates.  */\n static struct xor_block_template *__initdata template_list;\n static bool __initdata xor_forced = false;\n",
    "prefixes": [
        "22/28"
    ]
}