minixfs: Convert minix_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>
This commit is contained in:
Matthew Wilcox (Oracle) 2024-07-09 20:40:11 -04:00 committed by Christian Brauner
parent 6e9ead1ec9
commit e033fe609d
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2
3 changed files with 10 additions and 10 deletions

View File

@ -283,25 +283,25 @@ int minix_add_link(struct dentry *dentry, struct inode *inode)
goto out_put;
}
int minix_delete_entry(struct minix_dir_entry *de, struct page *page)
int minix_delete_entry(struct minix_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);
struct minix_sb_info *sbi = minix_sb(inode->i_sb);
unsigned len = sbi->s_dirsize;
int err;
lock_page(page);
err = minix_prepare_chunk(page, pos, len);
folio_lock(folio);
err = minix_prepare_chunk(&folio->page, pos, len);
if (err) {
unlock_page(page);
folio_unlock(folio);
return err;
}
if (sbi->s_version == MINIX_V3)
((minix3_dirent *)de)->inode = 0;
else
de->inode = 0;
dir_commit_chunk(page, pos, len);
dir_commit_chunk(&folio->page, pos, len);
inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
mark_inode_dirty(inode);
return minix_handle_dirsync(inode);

View File

@ -66,7 +66,7 @@ extern unsigned V2_minix_blocks(loff_t, struct super_block *);
struct minix_dir_entry *minix_find_entry(struct dentry *, struct folio **);
int minix_add_link(struct dentry*, struct inode*);
int minix_delete_entry(struct minix_dir_entry*, struct page*);
int minix_delete_entry(struct minix_dir_entry *, struct folio *);
int minix_make_empty(struct inode*, struct inode*);
int minix_empty_dir(struct inode*);
int minix_set_link(struct minix_dir_entry *de, struct folio *folio,

View File

@ -148,7 +148,7 @@ static int minix_unlink(struct inode * dir, struct dentry *dentry)
de = minix_find_entry(dentry, &folio);
if (!de)
return -ENOENT;
err = minix_delete_entry(de, &folio->page);
err = minix_delete_entry(de, folio);
folio_release_kmap(folio, de);
if (err)
@ -228,7 +228,7 @@ static int minix_rename(struct mnt_idmap *idmap,
inode_inc_link_count(new_dir);
}
err = minix_delete_entry(old_de, &old_folio->page);
err = minix_delete_entry(old_de, old_folio);
if (err)
goto out_dir;