get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1890362,
    "url": "http://patchwork.ozlabs.org/api/patches/1890362/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20240124175302.1750912-10-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-10-willy@infradead.org>",
    "list_archive_url": null,
    "date": "2024-01-24T17:52:52",
    "name": "[v2,09/15] ubifs: Convert ubifs_write_end() to use a folio",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0e84fc8d5647ec7d9da97f6de98ece409d203122",
    "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-10-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/1890362/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1890362/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=uY7gfQKD;\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=LHdHfqMY;\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 4TKs5Q2R1Mz23g9\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 1rShR6-004ZsU-24;\n\tWed, 24 Jan 2024 17:53:16 +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-004Zn8-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-00000007LVk-27e8;\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=QuCm/oEDT/Rp2Cie4PYikxRRnfAuB09c1dAVgr9V2dI=; b=uY7gfQKDhdT6zN\n\t5zIhR9oN94qBDLZ0kXT8iMAusFj5nyy7FtgB2mm44+ehQM/CmIHYZifYm51l+erqB6r60aAWUWG5R\n\tHlG9irF2P392bL2JBppsWyOpofafTaYzEMypAOo8YpPqyFcTlCjvUTnGJ5of0QHE365W9Kp4dPO8U\n\tIFx+OHbeAziX4xEXxiZhsSLQB82pDQQIwELLYB11Pdk6X/AvvHz10oFapp4tibieeZRbFYtMrfwYW\n\typyTSCA1yEd1Y5Ca8AfYVJKc+/t5PIVFhs5G5LOkZ5etmWbCQ5o7+c7HsHT99C3BpIAdf2ZzDn8mO\n\te+aX9Kwk6LCzzFuNgbpw==;",
            "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=yIKdpzmpN/EGIwbe5YdTmNHTSfTuw6kJAeOp8vViH8Y=; b=LHdHfqMYfBHTY8cfTIT/VcfjxO\n\tRJQybDMv+9bisFq6OWFfH/lMqdITGhghqtosgbYaY6RUdiQ04pIrRsQ+ha9B5G3MVkjokb3IMGxW9\n\tAbiExMZFKMMC8YbBOha8rpEvbEMDlYC3L4/wJLgzlaKYEqpX9CBCl9qZuazYijhaDOPJiIMElANTk\n\tdvj1EjBqMlnFjvZoKpm+tWN8B23eyVCuLOV5EPMHjpzTN74Nl9iRRfEFhm3MhwX0dRTV1408nLFwD\n\tee0YUptsly2ESaQMI+W9aPsYpZwxjYkBMXh+iyTS3CvPnXYca7pZTUEAaQwGIPZJrRhXRvo5Xwhp9\n\tHPIU41Kg==;"
        ],
        "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 09/15] ubifs: Convert ubifs_write_end() to use a folio",
        "Date": "Wed, 24 Jan 2024 17:52:52 +0000",
        "Message-ID": "<20240124175302.1750912-10-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": "Convert the incoming page pointer to a folio and use it throughout,\nsaving several calls to compound_head().  Also remove some PAGE_SIZE\nassumptions.\n\nSigned-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>\n---\n fs/ubifs/file.c | 41 +++++++++++++++++++++--------------------\n 1 file changed, 21 insertions(+), 20 deletions(-)",
    "diff": "diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c\nindex 13c078bdf156..feab95b59b05 100644\n--- a/fs/ubifs/file.c\n+++ b/fs/ubifs/file.c\n@@ -530,6 +530,7 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,\n \t\t\t   loff_t pos, unsigned len, unsigned copied,\n \t\t\t   struct page *page, void *fsdata)\n {\n+\tstruct folio *folio = page_folio(page);\n \tstruct inode *inode = mapping->host;\n \tstruct ubifs_inode *ui = ubifs_inode(inode);\n \tstruct ubifs_info *c = inode->i_sb->s_fs_info;\n@@ -537,47 +538,47 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,\n \tint appending = !!(end_pos > inode->i_size);\n \n \tdbg_gen(\"ino %lu, pos %llu, pg %lu, len %u, copied %d, i_size %lld\",\n-\t\tinode->i_ino, pos, page->index, len, copied, inode->i_size);\n+\t\tinode->i_ino, pos, folio->index, len, copied, inode->i_size);\n \n-\tif (unlikely(copied < len && len == PAGE_SIZE)) {\n+\tif (unlikely(copied < len && !folio_test_uptodate(folio))) {\n \t\t/*\n-\t\t * VFS copied less data to the page that it intended and\n+\t\t * VFS copied less data to the folio than it intended and\n \t\t * declared in its '->write_begin()' call via the @len\n-\t\t * argument. If the page was not up-to-date, and @len was\n-\t\t * @PAGE_SIZE, the 'ubifs_write_begin()' function did\n+\t\t * argument. If the folio was not up-to-date,\n+\t\t * the 'ubifs_write_begin()' function did\n \t\t * not load it from the media (for optimization reasons). This\n-\t\t * means that part of the page contains garbage. So read the\n-\t\t * page now.\n+\t\t * means that part of the folio contains garbage. So read the\n+\t\t * folio now.\n \t\t */\n \t\tdbg_gen(\"copied %d instead of %d, read page and repeat\",\n \t\t\tcopied, len);\n-\t\tcancel_budget(c, page, ui, appending);\n-\t\tClearPageChecked(page);\n+\t\tcancel_budget(c, &folio->page, ui, appending);\n+\t\tfolio_clear_checked(folio);\n \n \t\t/*\n \t\t * Return 0 to force VFS to repeat the whole operation, or the\n \t\t * error code if 'do_readpage()' fails.\n \t\t */\n-\t\tcopied = do_readpage(page);\n+\t\tcopied = do_readpage(&folio->page);\n \t\tgoto out;\n \t}\n \n-\tif (len == PAGE_SIZE)\n-\t\tSetPageUptodate(page);\n+\tif (len == folio_size(folio))\n+\t\tfolio_mark_uptodate(folio);\n \n-\tif (!PagePrivate(page)) {\n-\t\tattach_page_private(page, (void *)1);\n+\tif (!folio->private) {\n+\t\tfolio_attach_private(folio, (void *)1);\n \t\tatomic_long_inc(&c->dirty_pg_cnt);\n-\t\t__set_page_dirty_nobuffers(page);\n+\t\tfilemap_dirty_folio(mapping, folio);\n \t}\n \n \tif (appending) {\n \t\ti_size_write(inode, end_pos);\n \t\tui->ui_size = end_pos;\n \t\t/*\n-\t\t * Note, we do not set @I_DIRTY_PAGES (which means that the\n-\t\t * inode has dirty pages), this has been done in\n-\t\t * '__set_page_dirty_nobuffers()'.\n+\t\t * We do not set @I_DIRTY_PAGES (which means that\n+\t\t * the inode has dirty pages), this was done in\n+\t\t * filemap_dirty_folio().\n \t\t */\n \t\t__mark_inode_dirty(inode, I_DIRTY_DATASYNC);\n \t\tubifs_assert(c, mutex_is_locked(&ui->ui_mutex));\n@@ -585,8 +586,8 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,\n \t}\n \n out:\n-\tunlock_page(page);\n-\tput_page(page);\n+\tfolio_unlock(folio);\n+\tfolio_put(folio);\n \treturn copied;\n }\n \n",
    "prefixes": [
        "v2",
        "09/15"
    ]
}