summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-07-08 17:47:06 -0400
committerChristian Brauner <brauner@kernel.org>2024-08-07 11:31:52 +0200
commit128d1e89acb978bf6a4ec0d04bbfe8cb801965be (patch)
tree40ee96c441cd69c1ec488cf857a12f2ac1bf16e2
parentf4a20e53aba74b406f3becf28cc3776ad38153e7 (diff)
downloadlwn-128d1e89acb978bf6a4ec0d04bbfe8cb801965be.tar.gz
lwn-128d1e89acb978bf6a4ec0d04bbfe8cb801965be.zip
ufs: Convert ufs_prepare_chunk() to take a folio
All callers now have a folio, so convert ufs_prepare_chunk() to take one. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/ufs/dir.c8
-rw-r--r--fs/ufs/inode.c4
-rw-r--r--fs/ufs/util.h6
3 files changed, 9 insertions, 9 deletions
diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c
index 6a2a6af38097..a20f66351c66 100644
--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -97,7 +97,7 @@ void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de,
int err;
folio_lock(folio);
- err = ufs_prepare_chunk(&folio->page, pos, len);
+ err = ufs_prepare_chunk(folio, pos, len);
BUG_ON(err);
de->d_ino = cpu_to_fs32(dir->i_sb, inode->i_ino);
@@ -366,7 +366,7 @@ int ufs_add_link(struct dentry *dentry, struct inode *inode)
got_it:
pos = folio_pos(folio) + offset_in_folio(folio, de);
- err = ufs_prepare_chunk(&folio->page, pos, rec_len);
+ err = ufs_prepare_chunk(folio, pos, rec_len);
if (err)
goto out_unlock;
if (de->d_ino) {
@@ -521,7 +521,7 @@ int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir,
from = offset_in_folio(folio, pde);
pos = folio_pos(folio) + from;
folio_lock(folio);
- err = ufs_prepare_chunk(&folio->page, pos, to - from);
+ err = ufs_prepare_chunk(folio, pos, to - from);
BUG_ON(err);
if (pde)
pde->d_reclen = cpu_to_fs16(sb, to - from);
@@ -549,7 +549,7 @@ int ufs_make_empty(struct inode * inode, struct inode *dir)
if (IS_ERR(folio))
return PTR_ERR(folio);
- err = ufs_prepare_chunk(&folio->page, 0, chunk_size);
+ err = ufs_prepare_chunk(folio, 0, chunk_size);
if (err) {
folio_unlock(folio);
goto fail;
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index a7bb2e63cdde..0e608fc0d0fd 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -479,9 +479,9 @@ static int ufs_read_folio(struct file *file, struct folio *folio)
return block_read_full_folio(folio, ufs_getfrag_block);
}
-int ufs_prepare_chunk(struct page *page, loff_t pos, unsigned len)
+int ufs_prepare_chunk(struct folio *folio, loff_t pos, unsigned len)
{
- return __block_write_begin(page, pos, len, ufs_getfrag_block);
+ return __block_write_begin(&folio->page, pos, len, ufs_getfrag_block);
}
static void ufs_truncate_blocks(struct inode *);
diff --git a/fs/ufs/util.h b/fs/ufs/util.h
index 0ecd2ed792f5..bf708b68f150 100644
--- a/fs/ufs/util.h
+++ b/fs/ufs/util.h
@@ -250,9 +250,9 @@ ufs_set_inode_gid(struct super_block *sb, struct ufs_inode *inode, u32 value)
}
}
-extern dev_t ufs_get_inode_dev(struct super_block *, struct ufs_inode_info *);
-extern void ufs_set_inode_dev(struct super_block *, struct ufs_inode_info *, dev_t);
-extern int ufs_prepare_chunk(struct page *page, loff_t pos, unsigned len);
+dev_t ufs_get_inode_dev(struct super_block *, struct ufs_inode_info *);
+void ufs_set_inode_dev(struct super_block *, struct ufs_inode_info *, dev_t);
+int ufs_prepare_chunk(struct folio *folio, loff_t pos, unsigned len);
/*
* These functions manipulate ufs buffers