linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: linux-fsdevel@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	Al Viro <viro@zeniv.linux.org.uk>, Christoph Hellwig <hch@lst.de>
Subject: [PATCH 5/7] minixfs: Convert minix_make_empty() to use a folio
Date: Wed, 10 Jul 2024 02:23:19 +0100	[thread overview]
Message-ID: <20240710012323.2039519-6-willy@infradead.org> (raw)
In-Reply-To: <20240710012323.2039519-1-willy@infradead.org>

Removes a few hidden calls to compound_head().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/minix/dir.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/minix/dir.c b/fs/minix/dir.c
index 994bbbd3dea2..15b3ef1e473c 100644
--- a/fs/minix/dir.c
+++ b/fs/minix/dir.c
@@ -309,21 +309,21 @@ int minix_delete_entry(struct minix_dir_entry *de, struct folio *folio)
 
 int minix_make_empty(struct inode *inode, struct inode *dir)
 {
-	struct page *page = grab_cache_page(inode->i_mapping, 0);
+	struct folio *folio = filemap_grab_folio(inode->i_mapping, 0);
 	struct minix_sb_info *sbi = minix_sb(inode->i_sb);
 	char *kaddr;
 	int err;
 
-	if (!page)
-		return -ENOMEM;
-	err = minix_prepare_chunk(page, 0, 2 * sbi->s_dirsize);
+	if (IS_ERR(folio))
+		return PTR_ERR(folio);
+	err = minix_prepare_chunk(&folio->page, 0, 2 * sbi->s_dirsize);
 	if (err) {
-		unlock_page(page);
+		folio_unlock(folio);
 		goto fail;
 	}
 
-	kaddr = kmap_local_page(page);
-	memset(kaddr, 0, PAGE_SIZE);
+	kaddr = kmap_local_folio(folio, 0);
+	memset(kaddr, 0, folio_size(folio));
 
 	if (sbi->s_version == MINIX_V3) {
 		minix3_dirent *de3 = (minix3_dirent *)kaddr;
@@ -344,10 +344,10 @@ int minix_make_empty(struct inode *inode, struct inode *dir)
 	}
 	kunmap_local(kaddr);
 
-	dir_commit_chunk(page, 0, 2 * sbi->s_dirsize);
+	dir_commit_chunk(&folio->page, 0, 2 * sbi->s_dirsize);
 	err = minix_handle_dirsync(inode);
 fail:
-	put_page(page);
+	folio_put(folio);
 	return err;
 }
 
-- 
2.43.0


  parent reply	other threads:[~2024-07-10  1:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10  1:23 [PATCH 0/7] Convert minixfs directory handling to folios Matthew Wilcox (Oracle)
2024-07-10  1:23 ` [PATCH 1/7] minixfs: Convert dir_get_page() to dir_get_folio() Matthew Wilcox (Oracle)
2024-07-10  1:23 ` [PATCH 2/7] minixfs: Convert minix_find_entry() to take a folio Matthew Wilcox (Oracle)
2024-07-10  1:23 ` [PATCH 3/7] minifs: Convert minix_set_link() and minix_dotdot() " Matthew Wilcox (Oracle)
2024-07-10  1:23 ` [PATCH 4/7] minixfs: Convert minix_delete_entry() to work on " Matthew Wilcox (Oracle)
2024-07-10  1:23 ` Matthew Wilcox (Oracle) [this message]
2024-07-10  1:23 ` [PATCH 6/7] minixfs: Convert minix_prepare_chunk() to take " Matthew Wilcox (Oracle)
2024-07-10  1:23 ` [PATCH 7/7] minixfs: Convert dir_commit_chunk() " Matthew Wilcox (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240710012323.2039519-6-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).