get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2226966,
    "url": "http://patchwork.ozlabs.org/api/patches/2226966/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/patch/177689989646.3821326.14492655485067596223.stgit@frogsfrogsfrogs/",
    "project": {
        "id": 8,
        "url": "http://patchwork.ozlabs.org/api/projects/8/?format=api",
        "name": "Linux ext4 filesystem development",
        "link_name": "linux-ext4",
        "list_id": "linux-ext4.vger.kernel.org",
        "list_email": "linux-ext4@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<177689989646.3821326.14492655485067596223.stgit@frogsfrogsfrogs>",
    "list_archive_url": null,
    "date": "2026-04-22T23:25:09",
    "name": "[06/10] fuse4fs: hoist some code out of fuse4fs_main",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7971a01625244fab43822895871da3df71fa72ef",
    "submitter": {
        "id": 77032,
        "url": "http://patchwork.ozlabs.org/api/people/77032/?format=api",
        "name": "Darrick J. Wong",
        "email": "djwong@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ext4/patch/177689989646.3821326.14492655485067596223.stgit@frogsfrogsfrogs/mbox/",
    "series": [
        {
            "id": 501127,
            "url": "http://patchwork.ozlabs.org/api/series/501127/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ext4/list/?series=501127",
            "date": "2026-04-22T23:23:47",
            "name": "[01/10] libext2fs: make it possible to extract the fd from an IO manager",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501127/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2226966/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2226966/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <SRS0=3h7m=CV=vger.kernel.org=linux-ext4+bounces-16010-patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-ext4@vger.kernel.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "patchwork-incoming@ozlabs.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=fojfrIVW;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org\n (client-ip=150.107.74.76; helo=mail.ozlabs.org;\n envelope-from=srs0=3h7m=cv=vger.kernel.org=linux-ext4+bounces-16010-patchwork-incoming=ozlabs.org@ozlabs.org;\n receiver=patchwork.ozlabs.org)",
            "gandalf.ozlabs.org;\n arc=pass smtp.remote-ip=172.234.253.10 arc.chain=subspace.kernel.org",
            "gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org",
            "gandalf.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=fojfrIVW;\n\tdkim-atps=neutral",
            "gandalf.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16010-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"fojfrIVW\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"
        ],
        "Received": [
            "from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76])\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 4g1Fkw3PN7z1yDD\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 09:27:52 +1000 (AEST)",
            "from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3])\n\tby gandalf.ozlabs.org (Postfix) with ESMTP id 4g1Fkw2svpz4wCM\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 09:27:52 +1000 (AEST)",
            "by gandalf.ozlabs.org (Postfix)\n\tid 4g1Fkw2nrYz4wHx; Thu, 23 Apr 2026 09:27:52 +1000 (AEST)",
            "from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\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 gandalf.ozlabs.org (Postfix) with ESMTPS id 4g1Fkr655rz4wCM\n\tfor <patchwork-incoming@ozlabs.org>; Thu, 23 Apr 2026 09:27:48 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 6E81830DCCDA\n\tfor <patchwork-incoming@ozlabs.org>; Wed, 22 Apr 2026 23:25:11 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 2042039E19A;\n\tWed, 22 Apr 2026 23:25:10 +0000 (UTC)",
            "from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\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 D68791D6DA9;\n\tWed, 22 Apr 2026 23:25:09 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id B3242C2BCAF;\n\tWed, 22 Apr 2026 23:25:09 +0000 (UTC)"
        ],
        "ARC-Seal": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707; t=1776900472; cv=pass;\n\tb=mIYucMYe7DGpcs71LUfPQag9oqxcxTTGS8bgBAxIMF0TUyFU/Eym2UfhpHKU/eZT9NLuupx31fWPBAA3rtIsRR0Ce8lHkuFo41u0f0RVYNTtqQrZE79WJeiSL4HZ4rrcynSGRbVijHGPdZw+FrmG886t7HW+OMtJmQrx6a/xsvwJ9oquCIGsMyhJthYxRFmkEkOrOb+vnvKE08ZRZLhfnjmlsbT6M1NHBB7Qebb48KP7qCgddilZsRHXcWmhFyujkB9hfkK97rhx/RHSCSBmHAVKhYdR067Mtp/5I6Um4Ob1oNqye7TznJOnsBAknzSPW59tP20p6hoZempfHgFQQw==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776900309; cv=none;\n b=j3mSFqWfKGZby5JfONp4cVk0ni6JL6GFqdus3vGQFJ/7j5rRDNI6k5s+Iuy2hBZywnq7ITXnyRaExjWvqcMzLziJYKxYdmHay+dz1Yfgp/9tG/BmNbzzU1PoJpKflORagYACbcZrnU/MQy3BqIx0oG8QnY+Tfxd65jG3jAYO168="
        ],
        "ARC-Message-Signature": [
            "i=2; a=rsa-sha256; d=ozlabs.org; s=201707;\n\tt=1776900472; c=relaxed/relaxed;\n\tbh=tDTmvLG3E49+GseOhRS/egWPsRYwLuun99KUnWbPU0s=;\n\th=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=wA/ePBlUQH6m+PwNBiLdEBM+K5BHTOGFvX6/gLgS3SSiL3qy4RfAKI4aEXlfQeMBmI1BOTUZqfjbyD3Ao9bOxnm8AErttqoiP3H9JlfXF+SshLQsDcdtNE8YxNaFc+1tDmLrX7EvO6+p9ieBmvWZOnKfSjetT5pSEvoq+2wUgadomqEecwxn5oB3+r+39MLK9/V7b8TAwuLtIkvz87QpvtUvvutLiwudgcAdGM+Wy+DdmCiumY/ixt5dsrk0Yh4loSRil1DttB3GJljzq1nKpH2oHmwWlk1hbGwx3mTad0K71r6fquT6kcHsky9egJ7DBVoYAR6c94dpi8se2WQP3Q==",
            "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776900309; c=relaxed/simple;\n\tbh=AQVvkzucSaB9N5C7vksLYzCRX5HzVgbtRQTaOYtYY0o=;\n\th=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=GpAtamfebGwIxvOB4XA3ZsmV2wACYqpGN85eC3ViIZSybnUhYbJD30OA+nHLjCttml4IQVLRFqCB12pkaQ48RKDo4oay+S9EpRenDTSI19G98Jlun8IlB8CBxlnrXk1JOLZ6g7bZ22qvgQyCjsWzn+IdNOmXq6bGUwXS5ckYvto="
        ],
        "ARC-Authentication-Results": [
            "i=2; gandalf.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=kernel.org;\n dkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=fojfrIVW; dkim-atps=neutral;\n spf=pass (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-ext4+bounces-16010-patchwork-incoming=ozlabs.org@vger.kernel.org;\n receiver=ozlabs.org) smtp.mailfrom=vger.kernel.org",
            "i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=fojfrIVW; arc=none smtp.client-ip=10.30.226.201"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1776900309;\n\tbh=AQVvkzucSaB9N5C7vksLYzCRX5HzVgbtRQTaOYtYY0o=;\n\th=Date:Subject:From:To:Cc:In-Reply-To:References:From;\n\tb=fojfrIVW+5czKM7ierPjdoIzoInN/cF7o61LMAjTDIlFDh3QamgSDJ9ClDCbVweif\n\t ojCjYgp5TNfZu0LjnA8GtOiD3lnTW/2LxBaQrVB6n+mKju8mFYOw/0mtyy8rYfv4mf\n\t vqSa/qyxFX9pjwbbzhPy0rEOUkXv4XFIFYcOuJXi7DcRtPQPbvoKBb3FFWd44jTQV/\n\t 2BDdVqCwJrLoeSQ+Pyiizarp9zgbCVnu2w5JelFbIAggM3Az8sZHrDwPvY0m/Vf4Eh\n\t j1TNoYFfeltF5e+aq0xVfL3JSaUdYtnUcbTe51lzVoKavNQ7wltoWRdwSVM7p3IiSk\n\t mV1QL9CEEOY8A==",
        "Date": "Wed, 22 Apr 2026 16:25:09 -0700",
        "Subject": "[PATCH 06/10] fuse4fs: hoist some code out of fuse4fs_main",
        "From": "\"Darrick J. Wong\" <djwong@kernel.org>",
        "To": "tytso@mit.edu",
        "Cc": "linux-fsdevel@vger.kernel.org, fuse-devel@lists.linux.dev,\n linux-ext4@vger.kernel.org, neal@gompa.dev, joannelkoong@gmail.com,\n miklos@szeredi.hu, bernd@bsbernd.com",
        "Message-ID": "<177689989646.3821326.14492655485067596223.stgit@frogsfrogsfrogs>",
        "In-Reply-To": "<177689989498.3821326.15497525132012299039.stgit@frogsfrogsfrogs>",
        "References": "<177689989498.3821326.15497525132012299039.stgit@frogsfrogsfrogs>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-ext4@vger.kernel.org",
        "List-Id": "<linux-ext4.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-ext4+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-ext4+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "X-Spam-Status": "No, score=-1.2 required=5.0 tests=ARC_SIGNED,ARC_VALID,\n\tDKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,\n\tMAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=disabled\n\tversion=4.0.1",
        "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on gandalf.ozlabs.org"
    },
    "content": "From: Darrick J. Wong <djwong@kernel.org>\n\nIn the next patch, we're going to create a separate fuse4fs_main\nfunction when we're running in service mode.  Hoist into separate\nhelpers the code that will be shared between the two functions.\n\nSigned-off-by: \"Darrick J. Wong\" <djwong@kernel.org>\n---\n fuse4fs/fuse4fs.c |   95 +++++++++++++++++++++++++++--------------------------\n 1 file changed, 49 insertions(+), 46 deletions(-)",
    "diff": "diff --git a/fuse4fs/fuse4fs.c b/fuse4fs/fuse4fs.c\nindex 13e1aae4b5d2e5..1203f074ac29b6 100644\n--- a/fuse4fs/fuse4fs.c\n+++ b/fuse4fs/fuse4fs.c\n@@ -6016,47 +6016,64 @@ static void fuse4fs_com_err_proc(const char *whoami, errcode_t code,\n \tfflush(stderr);\n }\n \n-static int fuse4fs_main(struct fuse_args *args, struct fuse4fs *ff)\n+static int fuse4fs_create_session(struct fuse4fs *ff, struct fuse_args *args,\n+\t\t\t\t  struct fuse_cmdline_opts *opts)\n {\n-\tstruct fuse_cmdline_opts opts;\n-\tstruct fuse_session *se;\n-\tstruct fuse_loop_config *loop_config = NULL;\n-\tint ret;\n-\n-\tif (fuse_parse_cmdline(args, &opts) != 0) {\n-\t\tret = 1;\n-\t\tgoto out;\n-\t}\n-\n \tif (ff->debug)\n-\t\topts.debug = true;\n+\t\topts->debug = true;\n \n-\tif (opts.show_help) {\n+\tif (opts->show_help) {\n \t\tfuse_cmdline_help();\n-\t\tret = 0;\n-\t\tgoto out_free_opts;\n+\t\treturn 0;\n \t}\n \n-\tif (opts.show_version) {\n+\tif (opts->show_version) {\n \t\tprintf(\"FUSE library version %s\\n\", fuse_pkgversion());\n-\t\tret = 0;\n-\t\tgoto out_free_opts;\n+\t\treturn 0;\n \t}\n \n-\tif (!opts.mountpoint) {\n+\tif (!opts->mountpoint) {\n \t\tfprintf(stderr, \"error: no mountpoint specified\\n\");\n-\t\tret = 2;\n-\t\tgoto out_free_opts;\n+\t\treturn 2;\n \t}\n \n-\tse = fuse_session_new(args, &fs_ops, sizeof(fs_ops), ff);\n-\tif (se == NULL) {\n-\t\tret = 3;\n-\t\tgoto out_free_opts;\n+\tff->fuse = fuse_session_new(args, &fs_ops, sizeof(fs_ops), ff);\n+\treturn ff->fuse ? 0 : 3;\n+}\n+\n+static int fuse4fs_event_loop(struct fuse4fs *ff,\n+\t\t\t      struct fuse_loop_config *loop_config,\n+\t\t\t      const struct fuse_cmdline_opts *opts)\n+{\n+\t/*\n+\t * Since there's a Big Kernel Lock around all the libext2fs code, we\n+\t * only need to start four threads -- one to decode a request, another\n+\t * to do the filesystem work, a third to transmit the reply, and a\n+\t * fourth to handle fuse notifications.\n+\t */\n+\tfuse_loop_cfg_set_clone_fd(loop_config, opts->clone_fd);\n+\tfuse_loop_cfg_set_idle_threads(loop_config, opts->max_idle_threads);\n+\tfuse_loop_cfg_set_max_threads(loop_config, 4);\n+\n+\treturn fuse_session_loop_mt(ff->fuse, loop_config) == 0 ? 0 : 8;\n+}\n+\n+static int fuse4fs_main(struct fuse_args *args, struct fuse4fs *ff)\n+{\n+\tstruct fuse_cmdline_opts opts;\n+\tstruct fuse_loop_config *loop_config = NULL;\n+\tint ret;\n+\n+\tif (fuse_parse_cmdline(args, &opts) != 0) {\n+\t\tret = 1;\n+\t\tgoto out;\n \t}\n-\tff->fuse = se;\n \n-\tif (fuse_session_mount(se, opts.mountpoint) != 0) {\n+\tret = fuse4fs_create_session(ff, args, &opts);\n+\tif (ret || !ff->fuse)\n+\t\tgoto out_free_opts;\n+\n+\tif (fuse_session_mount(ff->fuse, opts.mountpoint) != 0) {\n \t\tret = 4;\n \t\tgoto out_destroy_session;\n \t}\n@@ -6076,7 +6093,7 @@ static int fuse4fs_main(struct fuse_args *args, struct fuse4fs *ff)\n \t\tclose(ff->logfd);\n \tff->logfd = -1;\n \n-\tif (fuse_set_signal_handlers(se) != 0) {\n+\tif (fuse_set_signal_handlers(ff->fuse) != 0) {\n \t\tret = 6;\n \t\tgoto out_unmount;\n \t}\n@@ -6087,30 +6104,16 @@ static int fuse4fs_main(struct fuse_args *args, struct fuse4fs *ff)\n \t\tgoto out_remove_signal_handlers;\n \t}\n \n-\t/*\n-\t * Since there's a Big Kernel Lock around all the libext2fs code, we\n-\t * only need to start four threads -- one to decode a request, another\n-\t * to do the filesystem work, a third to transmit the reply, and a\n-\t * fourth to handle fuse notifications.\n-\t */\n-\tfuse_loop_cfg_set_clone_fd(loop_config, opts.clone_fd);\n-\tfuse_loop_cfg_set_idle_threads(loop_config, opts.max_idle_threads);\n-\tfuse_loop_cfg_set_max_threads(loop_config, 4);\n+\tret = fuse4fs_event_loop(ff, loop_config, &opts);\n \n-\tif (fuse_session_loop_mt(se, loop_config) != 0) {\n-\t\tret = 8;\n-\t\tgoto out_loopcfg;\n-\t}\n-\n-out_loopcfg:\n \tfuse_loop_cfg_destroy(loop_config);\n out_remove_signal_handlers:\n-\tfuse_remove_signal_handlers(se);\n+\tfuse_remove_signal_handlers(ff->fuse);\n out_unmount:\n-\tfuse_session_unmount(se);\n+\tfuse_session_unmount(ff->fuse);\n out_destroy_session:\n+\tfuse_session_destroy(ff->fuse);\n \tff->fuse = NULL;\n-\tfuse_session_destroy(se);\n out_free_opts:\n \tfree(opts.mountpoint);\n out:\n",
    "prefixes": [
        "06/10"
    ]
}