get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1890367,
    "url": "http://patchwork.ozlabs.org/api/patches/1890367/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20240124175302.1750912-11-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-11-willy@infradead.org>",
    "list_archive_url": null,
    "date": "2024-01-24T17:52:53",
    "name": "[v2,10/15] ubifs: Convert do_readpage() to take a folio",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "57d85ea541f09856996a9c3e8cbae146eff1333d",
    "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-11-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/1890367/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1890367/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=tLnOQoU4;\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=QyNGEle2;\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 4TKs5R4kfqz23g5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 25 Jan 2024 04:53:47 +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 1rShR2-004Zq6-2g;\n\tWed, 24 Jan 2024 17:53:12 +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-004ZnB-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-00000007LVm-2PD4;\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=6kUYiYwVCFBg9Qmyovgje580cfInb9PrqmsyG37T5Zs=; b=tLnOQoU4sKLDCN\n\tRfUfTRsrfzMMo39YgCVRZZT9LDQYiu95Ny5oFY7frb8lXMu/zbuGj4PYHkOfsInAPy27fAPt304S/\n\tzn7TYd9QNqlv41q1qdVT1pr2ruq5eELlSbDlRQHLi79uWJdGj2xCJKPIRwtexAWOPc8SU9t/jWyC1\n\t/Zj9WJwqZVEr92ptl1F1XNOADxWub7+0rS6WDqaiR/u2VwxE5xIPH0PtFr8INIo7ce3jTBW+1jN9y\n\tyUw3YG8cNupq6xrcwbHWGPKbf4g78lZ6s3GKsZym277QZC+Z5I1Yv3atcFvRRg4U+uW8ksA4K5gyI\n\tDuNC/8B7/FzIzCZ84g+Q==;",
            "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=3VPySplgqEpPTWCU5htFvwUd6dgERYMSGO7Mf1OrmkU=; b=QyNGEle2JRC+jUvJ2HdO3nIaum\n\tSBrxg/J7cd0inNwAABut16NPuZY+UNgBgWeIPf82NRdo3AvhRGcJoP3tEWO92bCyIKBf+WvsQW5QK\n\tdHBNKSu8gzXQDWq9euFlf1HpmqL35j/EdsLpagLBz9ifzmbXsdmx8LfNzhMr+u3fF067tpPsWhHX6\n\tT5Q2M/Hn/AifiYiDkfYaGrYM75/Lox6Vv7jfPF6zB34K3/BLk0R92N7uZu7sLLBYuBmh0hUPrReq1\n\tY+KU18yf3KrKwJe+7RMJjVXwcTzI1SE+NZggtT5XbT4ykCicUi69MtOPqkyH2v4xzPIWxfwwdxkSD\n\tfbFNRfrA==;"
        ],
        "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 10/15] ubifs: Convert do_readpage() to take a folio",
        "Date": "Wed, 24 Jan 2024 17:52:53 +0000",
        "Message-ID": "<20240124175302.1750912-11-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": "All the callers now have a folio, so pass it in, and convert do_readpage()\nto us folios directly.  Includes unifying the exit paths from this\nfunction and using kmap_local instead of plain kmap.  This function\nshould now work with large folios, but this is not tested.\n\nSigned-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>\nReviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>\n---\n fs/ubifs/file.c | 64 +++++++++++++++++++++++--------------------------\n 1 file changed, 30 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c\nindex feab95b59b05..654af636b11d 100644\n--- a/fs/ubifs/file.c\n+++ b/fs/ubifs/file.c\n@@ -96,36 +96,36 @@ static int read_block(struct inode *inode, void *addr, unsigned int block,\n \treturn -EINVAL;\n }\n \n-static int do_readpage(struct page *page)\n+static int do_readpage(struct folio *folio)\n {\n \tvoid *addr;\n \tint err = 0, i;\n \tunsigned int block, beyond;\n-\tstruct ubifs_data_node *dn;\n-\tstruct inode *inode = page->mapping->host;\n+\tstruct ubifs_data_node *dn = NULL;\n+\tstruct inode *inode = folio->mapping->host;\n \tstruct ubifs_info *c = inode->i_sb->s_fs_info;\n \tloff_t i_size = i_size_read(inode);\n \n \tdbg_gen(\"ino %lu, pg %lu, i_size %lld, flags %#lx\",\n-\t\tinode->i_ino, page->index, i_size, page->flags);\n-\tubifs_assert(c, !PageChecked(page));\n-\tubifs_assert(c, !PagePrivate(page));\n+\t\tinode->i_ino, folio->index, i_size, folio->flags);\n+\tubifs_assert(c, !folio_test_checked(folio));\n+\tubifs_assert(c, !folio->private);\n \n-\taddr = kmap(page);\n+\taddr = kmap_local_folio(folio, 0);\n \n-\tblock = page->index << UBIFS_BLOCKS_PER_PAGE_SHIFT;\n+\tblock = folio->index << UBIFS_BLOCKS_PER_PAGE_SHIFT;\n \tbeyond = (i_size + UBIFS_BLOCK_SIZE - 1) >> UBIFS_BLOCK_SHIFT;\n \tif (block >= beyond) {\n \t\t/* Reading beyond inode */\n-\t\tSetPageChecked(page);\n-\t\tmemset(addr, 0, PAGE_SIZE);\n+\t\tfolio_set_checked(folio);\n+\t\taddr = folio_zero_tail(folio, 0, addr);\n \t\tgoto out;\n \t}\n \n \tdn = kmalloc(UBIFS_MAX_DATA_NODE_SZ, GFP_NOFS);\n \tif (!dn) {\n \t\terr = -ENOMEM;\n-\t\tgoto error;\n+\t\tgoto out;\n \t}\n \n \ti = 0;\n@@ -150,39 +150,35 @@ static int do_readpage(struct page *page)\n \t\t\t\t\tmemset(addr + ilen, 0, dlen - ilen);\n \t\t\t}\n \t\t}\n-\t\tif (++i >= UBIFS_BLOCKS_PER_PAGE)\n+\t\tif (++i >= (UBIFS_BLOCKS_PER_PAGE << folio_order(folio)))\n \t\t\tbreak;\n \t\tblock += 1;\n \t\taddr += UBIFS_BLOCK_SIZE;\n+\t\tif (folio_test_highmem(folio) && (offset_in_page(addr) == 0)) {\n+\t\t\tkunmap_local(addr - UBIFS_BLOCK_SIZE);\n+\t\t\taddr = kmap_local_folio(folio, i * UBIFS_BLOCK_SIZE);\n+\t\t}\n \t}\n+\n \tif (err) {\n \t\tstruct ubifs_info *c = inode->i_sb->s_fs_info;\n \t\tif (err == -ENOENT) {\n \t\t\t/* Not found, so it must be a hole */\n-\t\t\tSetPageChecked(page);\n+\t\t\tfolio_set_checked(folio);\n \t\t\tdbg_gen(\"hole\");\n-\t\t\tgoto out_free;\n+\t\t\terr = 0;\n+\t\t} else {\n+\t\t\tubifs_err(c, \"cannot read page %lu of inode %lu, error %d\",\n+\t\t\t\t  folio->index, inode->i_ino, err);\n \t\t}\n-\t\tubifs_err(c, \"cannot read page %lu of inode %lu, error %d\",\n-\t\t\t  page->index, inode->i_ino, err);\n-\t\tgoto error;\n \t}\n \n-out_free:\n-\tkfree(dn);\n out:\n-\tSetPageUptodate(page);\n-\tClearPageError(page);\n-\tflush_dcache_page(page);\n-\tkunmap(page);\n-\treturn 0;\n-\n-error:\n \tkfree(dn);\n-\tClearPageUptodate(page);\n-\tSetPageError(page);\n-\tflush_dcache_page(page);\n-\tkunmap(page);\n+\tif (!err)\n+\t\tfolio_mark_uptodate(folio);\n+\tflush_dcache_folio(folio);\n+\tkunmap_local(addr);\n \treturn err;\n }\n \n@@ -254,7 +250,7 @@ static int write_begin_slow(struct address_space *mapping,\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(&folio->page);\n+\t\t\terr = do_readpage(folio);\n \t\t\tif (err) {\n \t\t\t\tfolio_unlock(folio);\n \t\t\t\tfolio_put(folio);\n@@ -455,7 +451,7 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping,\n \t\t\tfolio_set_checked(folio);\n \t\t\tskipped_read = 1;\n \t\t} else {\n-\t\t\terr = do_readpage(&folio->page);\n+\t\t\terr = do_readpage(folio);\n \t\t\tif (err) {\n \t\t\t\tfolio_unlock(folio);\n \t\t\t\tfolio_put(folio);\n@@ -559,7 +555,7 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,\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(&folio->page);\n+\t\tcopied = do_readpage(folio);\n \t\tgoto out;\n \t}\n \n@@ -895,7 +891,7 @@ static int ubifs_read_folio(struct file *file, struct folio *folio)\n \n \tif (ubifs_bulk_read(page))\n \t\treturn 0;\n-\tdo_readpage(page);\n+\tdo_readpage(folio);\n \tfolio_unlock(folio);\n \treturn 0;\n }\n",
    "prefixes": [
        "v2",
        "10/15"
    ]
}