From patchwork Wed Jan 24 17:52:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 1890363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=F3P23mnd; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=e0C2m+c9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TKs5Q2JDqz23g8 for ; Thu, 25 Jan 2024 04:53:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V+zG36FKIX2oDMRaBRWJtmjGQBlL6dJHucFOnLgeUJw=; b=F3P23mndhwoi2l B93pkZ9DHqfqCWTG9XGehvb/lELIDK7Y2QWVruBw5oH+oeZK/ZO2dVHRpT0kS/OmLfvXNfG1x7hYF MfduWHOshfeurKmFpVdkzfIIjvbcCbvJ3+bzzU6nvnnv7tzyBrYPrwRkTyk48xDVsCPx9gvXJdv88 tq9JFjaJIIhPe+9O6JSg0QoxhoauUx3rYJUEgRe8WmuDU9rXPsoTunObEhWGJX+Emq1iIP2NXib2z Sdg2MwGAU+BUboheUuVvuzIQhHSWhqh2JxATW+scHmbDoaReYAnpGXG/Y4A+yz0OWWRHjZKOViS9h MIlw37OqlPbP5VXpgLbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rShRB-004Zvg-2Z; Wed, 24 Jan 2024 17:53:21 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rShR6-004ZsM-2J for linux-mtd@bombadil.infradead.org; Wed, 24 Jan 2024 17:53:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=IEVbAZZovLeCPkDNm6M1D+kYK+iHGLVWZ9I5CTFHVkc=; b=e0C2m+c9qAA2Prjf9+bwOMQCNm vt/eSEUChKHRN2B02FnQgFWAcA3I26Xu4SCasDOS2QMD/iTQPZnqO2rnnRUgK0DKjugWNFlRdzDzZ LRk1t707HAaiS54v2MVZXZWCmhiszlryXT8ehxvgYWVamgHKutLY8iNRuYjocEd0XbnC0WCqVvyCu 6mH7VgWSrnVGoj0DM0mUmhodYF8sXoKJN5qXFEV4OR3qo/+9UEEsNEsn2kvoWfS6bbEulmpNxwrU8 g+JOkUgKZGvJMlL+FteHU3O1ymrGxuXpMykuvKAjEb6v2RFGyGCtyHbQyfHCHalJolU4MnmK/wSOI 5KzRYCqA==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rShQv-00000007LVu-3ITG; Wed, 24 Jan 2024 17:53:05 +0000 From: "Matthew Wilcox (Oracle)" To: Richard Weinberger Cc: "Matthew Wilcox (Oracle)" , linux-mtd@lists.infradead.org, Zhihao Cheng Subject: [PATCH v2 12/15] ubifs: Convert cancel_budget() to take a folio Date: Wed, 24 Jan 2024 17:52:55 +0000 Message-ID: <20240124175302.1750912-13-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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The one caller already has a folio, so pass it in instead of the page. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zhihao Cheng --- fs/ubifs/file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 5542d73db717..9cd2e6d37c5d 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -499,14 +499,14 @@ static int ubifs_write_begin(struct file *file, struct address_space *mapping, /** * cancel_budget - cancel budget. * @c: UBIFS file-system description object - * @page: page to cancel budget for + * @folio: folio to cancel budget for * @ui: UBIFS inode object the page belongs to * @appending: non-zero if the page is appended * * This is a helper function for a page write operation. It unlocks the * @ui->ui_mutex in case of appending. */ -static void cancel_budget(struct ubifs_info *c, struct page *page, +static void cancel_budget(struct ubifs_info *c, struct folio *folio, struct ubifs_inode *ui, int appending) { if (appending) { @@ -514,8 +514,8 @@ static void cancel_budget(struct ubifs_info *c, struct page *page, ubifs_release_dirty_inode_budget(c, ui); mutex_unlock(&ui->ui_mutex); } - if (!PagePrivate(page)) { - if (PageChecked(page)) + if (!folio->private) { + if (folio_test_checked(folio)) release_new_page_budget(c); else release_existing_page_budget(c); @@ -548,7 +548,7 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping, */ dbg_gen("copied %d instead of %d, read page and repeat", copied, len); - cancel_budget(c, &folio->page, ui, appending); + cancel_budget(c, folio, ui, appending); folio_clear_checked(folio); /*