Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1890373/?format=api
{ "id": 1890373, "url": "http://patchwork.ozlabs.org/api/patches/1890373/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-mtd/patch/20240124175302.1750912-4-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-4-willy@infradead.org>", "list_archive_url": null, "date": "2024-01-24T17:52:46", "name": "[v2,03/15] ubifs: Convert ubifs_writepage to use a folio", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "87ebf8dfa157ce00bf02f334c37501a95f68c6c6", "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-4-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/1890373/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1890373/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=GglU2V+S;\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=ZCdXiCpO;\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 4TKs5l5pMJz23f0\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 25 Jan 2024 04:54:03 +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 1rShRT-004aDI-28;\n\tWed, 24 Jan 2024 17:53:39 +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 1rShRR-004aBA-2e\n\tfor linux-mtd@bombadil.infradead.org;\n\tWed, 24 Jan 2024 17:53:37 +0000", "from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red\n Hat Linux))\n\tid 1rShQu-00000007LVR-3zpt;\n\tWed, 24 Jan 2024 17:53:04 +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=UvG2pojSHpxQPcpVZBY8qzKYJbVxj8pu5cpimu4Odcc=; b=GglU2V+SEJonCp\n\tEJS8rlQvfdIdwgDOzcV3dlTmQpD3nj4f+FKsE5xVazpodJrNwGO14gfUuRukOIC4K0qTKdXlg80BX\n\tPe3b3DtR86dbDacLCXv08w1J+Xu0v8gbSt3W7HtWRIp1S0CV7d6q3ZBZnr4cReMzNRrc44GmfI278\n\tZ/IFaPtJ5m+tdyF7gZL0OoF2atwzoXxlYC2ynMOTCINplf9dqQ8zQJXKnnhwnAdUNenviSvINAHvJ\n\tsNgyL6b5LeLaP8fbZPhvyQLb6T6zyDWMOkBJKRsPVW6aQUT4mbFWeT0KmB2Rz30ksIoSMeBOvmOrT\n\tEDEO6twHgDb6VxrGefMA==;", "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=bBV9wdg0ftfYMLoYCIiEOJkgpB1SWeaCu1Cd2JScvd4=; b=ZCdXiCpOtIjnffAS1/H0gvOaoT\n\tSjYtQFRfRRH372/Hag6vI3EFFm91jcxd1CAAidThKAryDyYmB3cpWEWYBtocO6mhF8nD4IWWMnMsd\n\tX+gZn2kE9C6QY3GNA+9WvjW9Zp9r+Jq3KUZ2VaIvwquQPixbRSfvby76QQTulDhOjvRVeA5Y8zjER\n\txA1J4ruw0Zj0QfctTtK4rMeaDoHiMuEroSFWi9S3+QJ0d8cycK6APocn3DX7Vo5QJCnzQxADthocG\n\tMf6d0REAxLv7n+VplmYXLFzHSivrBWXFk3rEWesz31qyK7CtXApQZ2bUECysI5hxakUalJjZngWTG\n\tNDD3n6tQ==;" ], "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 03/15] ubifs: Convert ubifs_writepage to use a folio", "Date": "Wed, 24 Jan 2024 17:52:46 +0000", "Message-ID": "<20240124175302.1750912-4-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": "We still pass the page down to do_writepage(), but ubifs_writepage()\nitself is now large folio safe. It also contains far fewer hidden calls\nto 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 | 39 +++++++++++++++++----------------------\n 1 file changed, 17 insertions(+), 22 deletions(-)", "diff": "diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c\nindex 2022a31006df..a4e8bec6c03c 100644\n--- a/fs/ubifs/file.c\n+++ b/fs/ubifs/file.c\n@@ -1004,21 +1004,18 @@ static int do_writepage(struct page *page, int len)\n static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc,\n \t\tvoid *data)\n {\n-\tstruct page *page = &folio->page;\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 \tstruct ubifs_inode *ui = ubifs_inode(inode);\n \tloff_t i_size = i_size_read(inode), synced_i_size;\n-\tpgoff_t end_index = i_size >> PAGE_SHIFT;\n-\tint err, len = i_size & (PAGE_SIZE - 1);\n-\tvoid *kaddr;\n+\tint err, len = folio_size(folio);\n \n \tdbg_gen(\"ino %lu, pg %lu, pg flags %#lx\",\n-\t\tinode->i_ino, page->index, page->flags);\n-\tubifs_assert(c, PagePrivate(page));\n+\t\tinode->i_ino, folio->index, folio->flags);\n+\tubifs_assert(c, folio->private != NULL);\n \n-\t/* Is the page fully outside @i_size? (truncate in progress) */\n-\tif (page->index > end_index || (page->index == end_index && !len)) {\n+\t/* Is the folio fully outside @i_size? (truncate in progress) */\n+\tif (folio_pos(folio) >= i_size) {\n \t\terr = 0;\n \t\tgoto out_unlock;\n \t}\n@@ -1027,9 +1024,9 @@ static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc,\n \tsynced_i_size = ui->synced_i_size;\n \tspin_unlock(&ui->ui_lock);\n \n-\t/* Is the page fully inside @i_size? */\n-\tif (page->index < end_index) {\n-\t\tif (page->index >= synced_i_size >> PAGE_SHIFT) {\n+\t/* Is the folio fully inside i_size? */\n+\tif (folio_pos(folio) + len <= i_size) {\n+\t\tif (folio_pos(folio) >= synced_i_size) {\n \t\t\terr = inode->i_sb->s_op->write_inode(inode, NULL);\n \t\t\tif (err)\n \t\t\t\tgoto out_redirty;\n@@ -1042,20 +1039,18 @@ 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(page, PAGE_SIZE);\n+\t\treturn do_writepage(&folio->page, len);\n \t}\n \n \t/*\n-\t * The page straddles @i_size. It must be zeroed out on each and every\n+\t * The folio straddles @i_size. It must be zeroed out on each and every\n \t * writepage invocation because it may be mmapped. \"A file is mapped\n \t * in multiples of the page size. For a file that is not a multiple of\n \t * the page size, the remaining memory is zeroed when mapped, and\n \t * writes to that region are not written out to the file.\"\n \t */\n-\tkaddr = kmap_atomic(page);\n-\tmemset(kaddr + len, 0, PAGE_SIZE - len);\n-\tflush_dcache_page(page);\n-\tkunmap_atomic(kaddr);\n+\tlen = i_size - folio_pos(folio);\n+\tfolio_zero_segment(folio, len, folio_size(folio));\n \n \tif (i_size > synced_i_size) {\n \t\terr = inode->i_sb->s_op->write_inode(inode, NULL);\n@@ -1063,16 +1058,16 @@ static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc,\n \t\t\tgoto out_redirty;\n \t}\n \n-\treturn do_writepage(page, len);\n+\treturn do_writepage(&folio->page, len);\n out_redirty:\n \t/*\n-\t * redirty_page_for_writepage() won't call ubifs_dirty_inode() because\n+\t * folio_redirty_for_writepage() won't call ubifs_dirty_inode() because\n \t * it passes I_DIRTY_PAGES flag while calling __mark_inode_dirty(), so\n \t * there is no need to do space budget for dirty inode.\n \t */\n-\tredirty_page_for_writepage(wbc, page);\n+\tfolio_redirty_for_writepage(wbc, folio);\n out_unlock:\n-\tunlock_page(page);\n+\tfolio_unlock(folio);\n \treturn err;\n }\n \n", "prefixes": [ "v2", "03/15" ] }