Commit c83311c5 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Use generic_set_sb_d_ops for standard casefolding d_ops

parent a2f54633
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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 @@ static int bch2_fs_get_tree(struct fs_context *fc)
	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 −0
Original line number Diff line number Diff line
@@ -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;