bcachefs: Use generic_set_sb_d_ops for standard casefolding d_ops

Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet
2025-04-26 11:38:58 -04:00
parent a2f546330e
commit c83311c5b9
2 changed files with 11 additions and 3 deletions
+8 -3
View File
@@ -66,6 +66,8 @@ static inline void bch2_inode_flags_to_vfs(struct bch_fs *c, struct bch_inode_in
if (bch2_inode_casefold(c, &inode->ei_inode))
inode->v.i_flags |= S_CASEFOLD;
else
inode->v.i_flags &= ~S_CASEFOLD;
}
void bch2_inode_update_after_write(struct btree_trans *trans,
@@ -848,10 +850,8 @@ int __bch2_unlink(struct inode *vdir, struct dentry *dentry,
set_nlink(&inode->v, 0);
}
if (IS_CASEFOLDED(vdir)) {
if (IS_CASEFOLDED(vdir))
d_invalidate(dentry);
d_prune_aliases(&inode->v);
}
err:
bch2_trans_put(trans);
bch2_unlock_inodes(INODE_UPDATE_LOCK, dir, inode);
@@ -2571,6 +2571,11 @@ got_sb:
if (ret)
goto err_put_super;
#ifdef CONFIG_UNICODE
sb->s_encoding = c->cf_encoding;
#endif
generic_set_sb_d_ops(sb);
vinode = bch2_vfs_inode_get(c, BCACHEFS_ROOT_SUBVOL_INUM);
ret = PTR_ERR_OR_ZERO(vinode);
bch_err_msg(c, ret, "mounting: error getting root inode");
+3
View File
@@ -343,6 +343,9 @@ bool bch2_reinherit_attrs(struct bch_inode_unpacked *dst_u,
bool ret = false;
for (id = 0; id < Inode_opt_nr; id++) {
if (!S_ISDIR(dst_u->bi_mode) && id == Inode_opt_casefold)
continue;
/* Skip attributes that were explicitly set on this inode */
if (dst_u->bi_fields_set & (1 << id))
continue;