diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-02-20 15:42:51 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-02-20 15:52:55 -0500 |
commit | dd1a882d17d6302bd3f48f87aec4018b75749de6 (patch) | |
tree | f9bf12bc5cf2e54eaa10da4a0a903464c1cf2b73 /libbcachefs/fs-ioctl.c | |
parent | 3e15e96cb9c90cca6f7fa3465697933c53f51228 (diff) |
Update bcachefs sources to 9736cbbc5cc3 bcachefs: bs > ps support
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/fs-ioctl.c')
-rw-r--r-- | libbcachefs/fs-ioctl.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libbcachefs/fs-ioctl.c b/libbcachefs/fs-ioctl.c index 15725b4c..4465a2a8 100644 --- a/libbcachefs/fs-ioctl.c +++ b/libbcachefs/fs-ioctl.c @@ -54,6 +54,31 @@ static int bch2_inode_flags_set(struct btree_trans *trans, (newflags & (BCH_INODE_nodump|BCH_INODE_noatime)) != newflags) return -EINVAL; + if ((newflags ^ oldflags) & BCH_INODE_casefolded) { +#ifdef CONFIG_UNICODE + int ret = 0; + /* Not supported on individual files. */ + if (!S_ISDIR(bi->bi_mode)) + return -EOPNOTSUPP; + + /* + * Make sure the dir is empty, as otherwise we'd need to + * rehash everything and update the dirent keys. + */ + ret = bch2_empty_dir_trans(trans, inode_inum(inode)); + if (ret < 0) + return ret; + + if (!bch2_request_incompat_feature(c,bcachefs_metadata_version_casefolding)) + return -EOPNOTSUPP; + + bch2_check_set_feature(c, BCH_FEATURE_casefolding); +#else + printk(KERN_ERR "Cannot use casefolding on a kernel without CONFIG_UNICODE\n"); + return -EOPNOTSUPP; +#endif + } + if (s->set_projinherit) { bi->bi_fields_set &= ~(1 << Inode_opt_project); bi->bi_fields_set |= ((int) s->projinherit << Inode_opt_project); |