get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1890360,
    "url": "http://patchwork.ozlabs.org/api/patches/1890360/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20240124175302.1750912-8-willy@infradead.org/",
    "project": {
        "id": 3,
        "url": "http://patchwork.ozlabs.org/api/projects/3/?format=api",
        "name": "Linux MTD development",
        "link_name": "linux-mtd",
        "list_id": "linux-mtd.lists.infradead.org",
        "list_email": "linux-mtd@lists.infradead.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20240124175302.1750912-8-willy@infradead.org>",
    "list_archive_url": null,
    "date": "2024-01-24T17:52:50",
    "name": "[v2,07/15] ubifs: Convert write_begin_slow() to use a folio",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "49618813fa9712956df10be3e5a021b0680cb431",
    "submitter": {
        "id": 70855,
        "url": "http://patchwork.ozlabs.org/api/people/70855/?format=api",
        "name": "Matthew Wilcox",
        "email": "willy@infradead.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20240124175302.1750912-8-willy@infradead.org/mbox/",
    "series": [
        {
            "id": 391975,
            "url": "http://patchwork.ozlabs.org/api/series/391975/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/list/?series=391975",
            "date": "2024-01-24T17:52:56",
            "name": "ubifs folio conversion",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/391975/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1890360/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1890360/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-mtd-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=OOUJ2r5E;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256\n header.s=casper.20170209 header.b=BwXL8DDX;\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-mtd-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 4TKs5Q1nj2z23f0\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 25 Jan 2024 04:53:46 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux))\n\tid 1rShR3-004Zr7-34;\n\tWed, 24 Jan 2024 17:53:13 +0000",
            "from casper.infradead.org ([2001:8b0:10b:1236::1])\n\tby bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux))\n\tid 1rShQz-004Zn1-2u\n\tfor linux-mtd@bombadil.infradead.org;\n\tWed, 24 Jan 2024 17:53:10 +0000",
            "from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red\n Hat Linux))\n\tid 1rShQv-00000007LVc-1M4m;\n\tWed, 24 Jan 2024 17:53:05 +0000"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=/0wEqc6hXcR1N0MhD0sYaZSFaI0RaVqgUfoM/qBbvM8=; b=OOUJ2r5E8Z44b9\n\tBYJkYm+0sQSWxRIAeicmEhP250GptH4bUNcNE9gwEopwnZvSn4F6tQ2VMmy7gyJxe99jgV5gHaNiJ\n\tBbaR3Cyub8Bs4tHN0yTt/eisfPGt0f69A3jP9C2HfZRY65ZVwr7cJHS1JYZRDFqqxrLurZnhtSNa3\n\tMBhc2Vb4a3xh9xUTdgKBklxCY0Ek4ahegdNu9MFOytJ8ACxCRCtsKlzops9iHeL+Y+1zOqpxA0KG5\n\tQgbHLSSBoD2GuBsM6FiZMpNDWcRS3+xpq650maQHtAznlTqDm07M94g1L+flQI3x1cX20MsTCnaFR\n\tc/Tg5cRf/+oHIXBcD/Jw==;",
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version:\n\tReferences:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:\n\tContent-Type:Content-ID:Content-Description;\n\tbh=MsLLiDOs5ykapzSY/981WXO083v47qOirmDZqu2Q0iQ=; b=BwXL8DDXFgH/JGMgzpRCHbsW8n\n\tq3PqJnoAMOEgFPOVPYJyIgbShBHE2T5fDsObM/aiUz0AFy+eVq9p3bAb650G0/gFRwHp6YnIqjmbx\n\tDZNEIOS3Z/PvNGCkXja4iY2hmqNEZFh3fFU2vUCoLcDDJJFQdpa7A+W1iRLNwmvtcfv/l93fOTn71\n\tSiyA5zt31yIPGr1v6092N9Cp/WWuPNmeK2sdR2i12jGKxOxolI7HEr4I6rYdqSnVgb1uOTSRrplFn\n\tHtAKKrMTJasDfpww6TUSI363GLNOXebALNveK405MKw8GN+gGwbWgnAOTte+aoFqsD9XtaDBGPUf2\n\tdZGXhkKQ==;"
        ],
        "From": "\"Matthew Wilcox (Oracle)\" <willy@infradead.org>",
        "To": "Richard Weinberger <richard@nod.at>",
        "Cc": "\"Matthew Wilcox (Oracle)\" <willy@infradead.org>,\n\tlinux-mtd@lists.infradead.org",
        "Subject": "[PATCH v2 07/15] ubifs: Convert write_begin_slow() to use a folio",
        "Date": "Wed, 24 Jan 2024 17:52:50 +0000",
        "Message-ID": "<20240124175302.1750912-8-willy@infradead.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240124175302.1750912-1-willy@infradead.org>",
        "References": "<20240124175302.1750912-1-willy@infradead.org>",
        "MIME-Version": "1.0",
        "X-BeenThere": "linux-mtd@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-mtd/>",
        "List-Post": "<mailto:linux-mtd@lists.infradead.org>",
        "List-Help": "<mailto:linux-mtd-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>",
        "Errors-To": "linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "Update to new APIs, removing several calls to compound_head() and\nincluding support for large folios.\n\nSigned-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>\n---\n fs/ubifs/file.c | 45 +++++++++++++++++++++++----------------------\n 1 file changed, 23 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c\nindex 3c4a98476c23..cc4d2ec95b70 100644\n--- a/fs/ubifs/file.c\n+++ b/fs/ubifs/file.c\n@@ -222,16 +222,16 @@ static int write_begin_slow(struct address_space *mapping,\n \tpgoff_t index = pos >> PAGE_SHIFT;\n \tstruct ubifs_budget_req req = { .new_page = 1 };\n \tint err, appending = !!(pos + len > inode->i_size);\n-\tstruct page *page;\n+\tstruct folio *folio;\n \n \tdbg_gen(\"ino %lu, pos %llu, len %u, i_size %lld\",\n \t\tinode->i_ino, pos, len, inode->i_size);\n \n \t/*\n-\t * At the slow path we have to budget before locking the page, because\n-\t * budgeting may force write-back, which would wait on locked pages and\n-\t * deadlock if we had the page locked. At this point we do not know\n-\t * anything about the page, so assume that this is a new page which is\n+\t * At the slow path we have to budget before locking the folio, because\n+\t * budgeting may force write-back, which would wait on locked folios and\n+\t * deadlock if we had the folio locked. At this point we do not know\n+\t * anything about the folio, so assume that this is a new folio which is\n \t * written to a hole. This corresponds to largest budget. Later the\n \t * budget will be amended if this is not true.\n \t */\n@@ -243,42 +243,43 @@ static int write_begin_slow(struct address_space *mapping,\n \tif (unlikely(err))\n \t\treturn err;\n \n-\tpage = grab_cache_page_write_begin(mapping, index);\n-\tif (unlikely(!page)) {\n+\tfolio = __filemap_get_folio(mapping, index, FGP_WRITEBEGIN,\n+\t\t\tmapping_gfp_mask(mapping));\n+\tif (IS_ERR(folio)) {\n \t\tubifs_release_budget(c, &req);\n-\t\treturn -ENOMEM;\n+\t\treturn PTR_ERR(folio);\n \t}\n \n-\tif (!PageUptodate(page)) {\n-\t\tif (!(pos & ~PAGE_MASK) && len == PAGE_SIZE)\n-\t\t\tSetPageChecked(page);\n+\tif (!folio_test_uptodate(folio)) {\n+\t\tif (pos == folio_pos(folio) && len >= folio_size(folio))\n+\t\t\tfolio_set_checked(folio);\n \t\telse {\n-\t\t\terr = do_readpage(page);\n+\t\t\terr = do_readpage(&folio->page);\n \t\t\tif (err) {\n-\t\t\t\tunlock_page(page);\n-\t\t\t\tput_page(page);\n+\t\t\t\tfolio_unlock(folio);\n+\t\t\t\tfolio_put(folio);\n \t\t\t\tubifs_release_budget(c, &req);\n \t\t\t\treturn err;\n \t\t\t}\n \t\t}\n \t}\n \n-\tif (PagePrivate(page))\n+\tif (folio->private)\n \t\t/*\n-\t\t * The page is dirty, which means it was budgeted twice:\n+\t\t * The folio is dirty, which means it was budgeted twice:\n \t\t *   o first time the budget was allocated by the task which\n-\t\t *     made the page dirty and set the PG_private flag;\n+\t\t *     made the folio dirty and set the private field;\n \t\t *   o and then we budgeted for it for the second time at the\n \t\t *     very beginning of this function.\n \t\t *\n-\t\t * So what we have to do is to release the page budget we\n+\t\t * So what we have to do is to release the folio budget we\n \t\t * allocated.\n \t\t */\n \t\trelease_new_page_budget(c);\n-\telse if (!PageChecked(page))\n+\telse if (!folio_test_checked(folio))\n \t\t/*\n-\t\t * We are changing a page which already exists on the media.\n-\t\t * This means that changing the page does not make the amount\n+\t\t * We are changing a folio which already exists on the media.\n+\t\t * This means that changing the folio does not make the amount\n \t\t * of indexing information larger, and this part of the budget\n \t\t * which we have already acquired may be released.\n \t\t */\n@@ -301,7 +302,7 @@ static int write_begin_slow(struct address_space *mapping,\n \t\t\tubifs_release_dirty_inode_budget(c, ui);\n \t}\n \n-\t*pagep = page;\n+\t*pagep = &folio->page;\n \treturn 0;\n }\n \n",
    "prefixes": [
        "v2",
        "07/15"
    ]
}