diff mbox series

[6/7] minixfs: Convert minix_prepare_chunk() to take a folio

Message ID 20240710012323.2039519-7-willy@infradead.org (mailing list archive)
State New
Headers show
Series Convert minixfs directory handling to folios | expand

Commit Message

Matthew Wilcox July 10, 2024, 1:23 a.m. UTC
All callers now have a folio, so convert minix_prepare_chunk() to
take one.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/minix/dir.c   |  8 ++++----
 fs/minix/inode.c |  4 ++--
 fs/minix/minix.h | 24 ++++++++++++------------
 3 files changed, 18 insertions(+), 18 deletions(-)
diff mbox series

Patch

diff --git a/fs/minix/dir.c b/fs/minix/dir.c
index 15b3ef1e473c..26bfea508028 100644
--- a/fs/minix/dir.c
+++ b/fs/minix/dir.c
@@ -260,7 +260,7 @@  int minix_add_link(struct dentry *dentry, struct inode *inode)
 
 got_it:
 	pos = folio_pos(folio) + offset_in_folio(folio, p);
-	err = minix_prepare_chunk(&folio->page, pos, sbi->s_dirsize);
+	err = minix_prepare_chunk(folio, pos, sbi->s_dirsize);
 	if (err)
 		goto out_unlock;
 	memcpy (namx, name, namelen);
@@ -292,7 +292,7 @@  int minix_delete_entry(struct minix_dir_entry *de, struct folio *folio)
 	int err;
 
 	folio_lock(folio);
-	err = minix_prepare_chunk(&folio->page, pos, len);
+	err = minix_prepare_chunk(folio, pos, len);
 	if (err) {
 		folio_unlock(folio);
 		return err;
@@ -316,7 +316,7 @@  int minix_make_empty(struct inode *inode, struct inode *dir)
 
 	if (IS_ERR(folio))
 		return PTR_ERR(folio);
-	err = minix_prepare_chunk(&folio->page, 0, 2 * sbi->s_dirsize);
+	err = minix_prepare_chunk(folio, 0, 2 * sbi->s_dirsize);
 	if (err) {
 		folio_unlock(folio);
 		goto fail;
@@ -413,7 +413,7 @@  int minix_set_link(struct minix_dir_entry *de, struct folio *folio,
 	int err;
 
 	folio_lock(folio);
-	err = minix_prepare_chunk(&folio->page, pos, sbi->s_dirsize);
+	err = minix_prepare_chunk(folio, pos, sbi->s_dirsize);
 	if (err) {
 		folio_unlock(folio);
 		return err;
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 1c3df63162ef..0002337977e0 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -427,9 +427,9 @@  static int minix_read_folio(struct file *file, struct folio *folio)
 	return block_read_full_folio(folio, minix_get_block);
 }
 
-int minix_prepare_chunk(struct page *page, loff_t pos, unsigned len)
+int minix_prepare_chunk(struct folio *folio, loff_t pos, unsigned len)
 {
-	return __block_write_begin(page, pos, len, minix_get_block);
+	return __block_write_begin(&folio->page, pos, len, minix_get_block);
 }
 
 static void minix_write_failed(struct address_space *mapping, loff_t to)
diff --git a/fs/minix/minix.h b/fs/minix/minix.h
index 063bab8faa6b..d54273c3c9ff 100644
--- a/fs/minix/minix.h
+++ b/fs/minix/minix.h
@@ -42,18 +42,18 @@  struct minix_sb_info {
 	unsigned short s_version;
 };
 
-extern struct inode *minix_iget(struct super_block *, unsigned long);
-extern struct minix_inode * minix_V1_raw_inode(struct super_block *, ino_t, struct buffer_head **);
-extern struct minix2_inode * minix_V2_raw_inode(struct super_block *, ino_t, struct buffer_head **);
-extern struct inode * minix_new_inode(const struct inode *, umode_t);
-extern void minix_free_inode(struct inode * inode);
-extern unsigned long minix_count_free_inodes(struct super_block *sb);
-extern int minix_new_block(struct inode * inode);
-extern void minix_free_block(struct inode *inode, unsigned long block);
-extern unsigned long minix_count_free_blocks(struct super_block *sb);
-extern int minix_getattr(struct mnt_idmap *, const struct path *,
-			 struct kstat *, u32, unsigned int);
-extern int minix_prepare_chunk(struct page *page, loff_t pos, unsigned len);
+struct inode *minix_iget(struct super_block *, unsigned long);
+struct minix_inode *minix_V1_raw_inode(struct super_block *, ino_t, struct buffer_head **);
+struct minix2_inode *minix_V2_raw_inode(struct super_block *, ino_t, struct buffer_head **);
+struct inode *minix_new_inode(const struct inode *, umode_t);
+void minix_free_inode(struct inode *inode);
+unsigned long minix_count_free_inodes(struct super_block *sb);
+int minix_new_block(struct inode *inode);
+void minix_free_block(struct inode *inode, unsigned long block);
+unsigned long minix_count_free_blocks(struct super_block *sb);
+int minix_getattr(struct mnt_idmap *, const struct path *,
+		struct kstat *, u32, unsigned int);
+int minix_prepare_chunk(struct folio *folio, loff_t pos, unsigned len);
 
 extern void V1_minix_truncate(struct inode *);
 extern void V2_minix_truncate(struct inode *);