get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1890370,
    "url": "http://patchwork.ozlabs.org/api/patches/1890370/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20240124175302.1750912-6-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-6-willy@infradead.org>",
    "list_archive_url": null,
    "date": "2024-01-24T17:52:48",
    "name": "[v2,05/15] ubifs: Convert do_writepage() to take a folio",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "f276077c64727ca453cd34f976952f9c3b393907",
    "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-6-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/1890370/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1890370/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=3Td5QXA5;\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=ezISrbp/;\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 4TKs5X6RgXz23f0\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 25 Jan 2024 04:53:52 +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 1rShRL-004a5Z-0P;\n\tWed, 24 Jan 2024 17:53:31 +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 1rShRI-004a2o-2E\n\tfor linux-mtd@bombadil.infradead.org;\n\tWed, 24 Jan 2024 17:53:28 +0000",
            "from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red\n Hat Linux))\n\tid 1rShQv-00000007LVY-0fwF;\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=lnBMbAw59yS0BN29OIZcGsPS4xD6NKo/Qkq4ViTJT5M=; b=3Td5QXA5YxA6vj\n\tLlAGpco1TeIa9oPSXQRnNwKVAa4+Pkv2rhAeRKe8Sc06yIQFY4+xlOvsnzDrh2bgptIjzV5dyf8sL\n\t8LfelCaZ9lG07TyLP58cWAOEFR4k6vNCiSV/0K3ZagcKon2blWVyU6Rh64qngMGzaoSkdIPuB3qsJ\n\tUXyc/+Xysq1rbEqPYim49KdMWF7d8qIUPwvGYh6bCgxwQexCH+SD+oVIhZtH8AQdZ9HAGY3NPBp3y\n\tziONoKxfxjZvfTZQnjg+b/KwDp17OVXD4I+I0EwEYx4jtwELQI4kWf9l04Tbplqgdmxiy10yZu3/Q\n\tIzLNUTn4yI2NKVvY4sng==;",
            "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=8AfaF6DytG47ELkiAdnea90zu+tdQdQf2u3VUPXkh5U=; b=ezISrbp/JtvNia0Hr27b5/LKPz\n\tSnOaMcag0iI81is3nfF2TlbY/cHeulAbCgF9dN5GNmpRWmIfLvwIwHrKbKFAc+n9DyYPlI38DT93u\n\tUdxqFZwyWQWVPe99H2qrrbWHOMHRg/AoMbMEtGGEpHKN4R7VX8+3C3DCiUPkY/1PvfdRoW5j2Yvxd\n\t0qSmxgfK2iMR5BU8O5uaSPkoXR0Ox4w6gYkO+roq42n2Zf+JMrnO6MYzvwdEgcJS8SF9P7M3lYFGe\n\tFfRe4/Kon7Cf6F0b5stgCFcaHSCGtZXXrMQqlEZtgzuCam2KgsUYRjuOueDM/savUr3rvIw66IbAX\n\tdfgOcuUw==;"
        ],
        "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,\n\tZhihao Cheng <chengzhihao1@huawei.com>",
        "Subject": "[PATCH v2 05/15] ubifs: Convert do_writepage() to take a folio",
        "Date": "Wed, 24 Jan 2024 17:52:48 +0000",
        "Message-ID": "<20240124175302.1750912-6-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": "Replace the call to SetPageError() with a call to mapping_set_error().\nSupport large folios by using kmap_local_folio() and remapping each time\nwe cross a page boundary.  Saves a lot of hidden calls to compound_head().\n\nSigned-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>\nReviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>\n---\n fs/ubifs/file.c | 56 ++++++++++++++++++++++++++-----------------------\n 1 file changed, 30 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c\nindex 7039c9006f24..70d391b72897 100644\n--- a/fs/ubifs/file.c\n+++ b/fs/ubifs/file.c\n@@ -898,60 +898,64 @@ static int ubifs_read_folio(struct file *file, struct folio *folio)\n \treturn 0;\n }\n \n-static int do_writepage(struct page *page, int len)\n+static int do_writepage(struct folio *folio, size_t len)\n {\n-\tint err = 0, i, blen;\n+\tint err = 0, blen;\n \tunsigned int block;\n \tvoid *addr;\n+\tsize_t offset = 0;\n \tunion ubifs_key key;\n-\tstruct inode *inode = page->mapping->host;\n+\tstruct inode *inode = folio->mapping->host;\n \tstruct ubifs_info *c = inode->i_sb->s_fs_info;\n \n #ifdef UBIFS_DEBUG\n \tstruct ubifs_inode *ui = ubifs_inode(inode);\n \tspin_lock(&ui->ui_lock);\n-\tubifs_assert(c, page->index <= ui->synced_i_size >> PAGE_SHIFT);\n+\tubifs_assert(c, folio->index <= ui->synced_i_size >> PAGE_SHIFT);\n \tspin_unlock(&ui->ui_lock);\n #endif\n \n-\t/* Update radix tree tags */\n-\tset_page_writeback(page);\n+\tfolio_start_writeback(folio);\n \n-\taddr = kmap(page);\n-\tblock = page->index << UBIFS_BLOCKS_PER_PAGE_SHIFT;\n-\ti = 0;\n-\twhile (len) {\n-\t\tblen = min_t(int, len, UBIFS_BLOCK_SIZE);\n+\taddr = kmap_local_folio(folio, offset);\n+\tblock = folio->index << UBIFS_BLOCKS_PER_PAGE_SHIFT;\n+\tfor (;;) {\n+\t\tblen = min_t(size_t, len, UBIFS_BLOCK_SIZE);\n \t\tdata_key_init(c, &key, inode->i_ino, block);\n \t\terr = ubifs_jnl_write_data(c, inode, &key, addr, blen);\n \t\tif (err)\n \t\t\tbreak;\n-\t\tif (++i >= UBIFS_BLOCKS_PER_PAGE)\n+\t\tlen -= blen;\n+\t\tif (!len)\n \t\t\tbreak;\n \t\tblock += 1;\n \t\taddr += blen;\n-\t\tlen -= blen;\n+\t\tif (folio_test_highmem(folio) && !offset_in_page(addr)) {\n+\t\t\tkunmap_local(addr - blen);\n+\t\t\toffset += PAGE_SIZE;\n+\t\t\taddr = kmap_local_folio(folio, offset);\n+\t\t}\n \t}\n+\tkunmap_local(addr);\n \tif (err) {\n-\t\tSetPageError(page);\n-\t\tubifs_err(c, \"cannot write page %lu of inode %lu, error %d\",\n-\t\t\t  page->index, inode->i_ino, err);\n+\t\tmapping_set_error(folio->mapping, err);\n+\t\tubifs_err(c, \"cannot write folio %lu of inode %lu, error %d\",\n+\t\t\t  folio->index, inode->i_ino, err);\n \t\tubifs_ro_mode(c, err);\n \t}\n \n-\tubifs_assert(c, PagePrivate(page));\n-\tif (PageChecked(page))\n+\tubifs_assert(c, folio->private != NULL);\n+\tif (folio_test_checked(folio))\n \t\trelease_new_page_budget(c);\n \telse\n \t\trelease_existing_page_budget(c);\n \n \tatomic_long_dec(&c->dirty_pg_cnt);\n-\tdetach_page_private(page);\n-\tClearPageChecked(page);\n+\tfolio_detach_private(folio);\n+\tfolio_clear_checked(folio);\n \n-\tkunmap(page);\n-\tunlock_page(page);\n-\tend_page_writeback(page);\n+\tfolio_unlock(folio);\n+\tfolio_end_writeback(folio);\n \treturn err;\n }\n \n@@ -1039,7 +1043,7 @@ static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc,\n \t\t\t * with this.\n \t\t\t */\n \t\t}\n-\t\treturn do_writepage(&folio->page, len);\n+\t\treturn do_writepage(folio, len);\n \t}\n \n \t/*\n@@ -1058,7 +1062,7 @@ static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc,\n \t\t\tgoto out_redirty;\n \t}\n \n-\treturn do_writepage(&folio->page, len);\n+\treturn do_writepage(folio, len);\n out_redirty:\n \t/*\n \t * folio_redirty_for_writepage() won't call ubifs_dirty_inode() because\n@@ -1172,7 +1176,7 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode,\n \t\t\t\tif (UBIFS_BLOCKS_PER_PAGE_SHIFT)\n \t\t\t\t\toffset = offset_in_folio(folio,\n \t\t\t\t\t\t\tnew_size);\n-\t\t\t\terr = do_writepage(&folio->page, offset);\n+\t\t\t\terr = do_writepage(folio, offset);\n \t\t\t\tfolio_put(folio);\n \t\t\t\tif (err)\n \t\t\t\t\tgoto out_budg;\n",
    "prefixes": [
        "v2",
        "05/15"
    ]
}