summaryrefslogtreecommitdiff
path: root/fs/sysv
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-07-09 10:45:23 -0400
committerChristian Brauner <brauner@kernel.org>2024-08-07 11:31:54 +0200
commit9b1cf7790e5ae631839e06b1f96a9d05e088b450 (patch)
tree986e7e6045810eefdf5f52aa0172f787f6b99064 /fs/sysv
parent1cfdaf9708ba7f2ff170723999fcdf87e9afb843 (diff)
sysv: Convert sysv_delete_entry() to work on a folio
Match ext2 and remove a few hidden calls to compound_head(). Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/sysv')
-rw-r--r--fs/sysv/dir.c14
-rw-r--r--fs/sysv/namei.c4
-rw-r--r--fs/sysv/sysv.h2
3 files changed, 10 insertions, 10 deletions
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
index ebccf7bb5b69..0b5727510bdd 100644
--- a/fs/sysv/dir.c
+++ b/fs/sysv/dir.c
@@ -231,20 +231,20 @@ out_unlock:
goto out_folio;
}
-int sysv_delete_entry(struct sysv_dir_entry *de, struct page *page)
+int sysv_delete_entry(struct sysv_dir_entry *de, struct folio *folio)
{
- struct inode *inode = page->mapping->host;
- loff_t pos = page_offset(page) + offset_in_page(de);
+ struct inode *inode = folio->mapping->host;
+ loff_t pos = folio_pos(folio) + offset_in_folio(folio, de);
int err;
- lock_page(page);
- err = sysv_prepare_chunk(page, pos, SYSV_DIRSIZE);
+ folio_lock(folio);
+ err = sysv_prepare_chunk(&folio->page, pos, SYSV_DIRSIZE);
if (err) {
- unlock_page(page);
+ folio_unlock(folio);
return err;
}
de->inode = 0;
- dir_commit_chunk(page, pos, SYSV_DIRSIZE);
+ dir_commit_chunk(&folio->page, pos, SYSV_DIRSIZE);
inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
mark_inode_dirty(inode);
return sysv_handle_dirsync(inode);
diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c
index ef4d91431225..fb8bd8437872 100644
--- a/fs/sysv/namei.c
+++ b/fs/sysv/namei.c
@@ -159,7 +159,7 @@ static int sysv_unlink(struct inode * dir, struct dentry * dentry)
if (!de)
return -ENOENT;
- err = sysv_delete_entry(de, &folio->page);
+ err = sysv_delete_entry(de, folio);
if (!err) {
inode_set_ctime_to_ts(inode, inode_get_ctime(dir));
inode_dec_link_count(inode);
@@ -242,7 +242,7 @@ static int sysv_rename(struct mnt_idmap *idmap, struct inode *old_dir,
inode_inc_link_count(new_dir);
}
- err = sysv_delete_entry(old_de, &old_folio->page);
+ err = sysv_delete_entry(old_de, old_folio);
if (err)
goto out_dir;
diff --git a/fs/sysv/sysv.h b/fs/sysv/sysv.h
index ee90af7dbed9..fec9f6b883d5 100644
--- a/fs/sysv/sysv.h
+++ b/fs/sysv/sysv.h
@@ -150,7 +150,7 @@ extern void sysv_destroy_icache(void);
/* dir.c */
struct sysv_dir_entry *sysv_find_entry(struct dentry *, struct folio **);
int sysv_add_link(struct dentry *, struct inode *);
-int sysv_delete_entry(struct sysv_dir_entry *, struct page *);
+int sysv_delete_entry(struct sysv_dir_entry *, struct folio *);
int sysv_make_empty(struct inode *, struct inode *);
int sysv_empty_dir(struct inode *);
int sysv_set_link(struct sysv_dir_entry *, struct folio *,