diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-06-03 15:53:44 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-07-22 12:05:15 -0400 |
commit | 0c4bb1f883a2bd8d9be970f1ffdfbfa3f55b148e (patch) | |
tree | a0b671c0fbb0eeabdc387a71a582bcbbe20ca508 | |
parent | 5031b7a8f10950ab3d7db5ce8a559f361f458561 (diff) |
bcachefs: Allow CONFIG_UNICODE=m
Fix the CONFIG_UNICODE checks - IS_ENABLED() is required when unicode is
bulit as a module.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/bcachefs.h | 2 | ||||
-rw-r--r-- | fs/bcachefs/dirent.c | 4 | ||||
-rw-r--r-- | fs/bcachefs/dirent.h | 2 | ||||
-rw-r--r-- | fs/bcachefs/fs.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/inode.c | 2 | ||||
-rw-r--r-- | fs/bcachefs/super.c | 4 |
6 files changed, 8 insertions, 8 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h index ddfacad0f70c..f4edbe2a14fd 100644 --- a/fs/bcachefs/bcachefs.h +++ b/fs/bcachefs/bcachefs.h @@ -1285,7 +1285,7 @@ static inline bool bch2_discard_opt_enabled(struct bch_fs *c, struct bch_dev *ca static inline bool bch2_fs_casefold_enabled(struct bch_fs *c) { -#ifdef CONFIG_UNICODE +#if IS_ENABLED(CONFIG_UNICODE) return !c->opts.casefold_disabled; #else return false; diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c index 28875c5c86ad..b06951673d49 100644 --- a/fs/bcachefs/dirent.c +++ b/fs/bcachefs/dirent.c @@ -13,7 +13,7 @@ #include <linux/dcache.h> -#ifdef CONFIG_UNICODE +#if IS_ENABLED(CONFIG_UNICODE) int bch2_casefold(struct btree_trans *trans, const struct bch_hash_info *info, const struct qstr *str, struct qstr *out_cf) { @@ -256,7 +256,7 @@ int bch2_dirent_init_name(struct bch_fs *c, if (!bch2_fs_casefold_enabled(c)) return -EOPNOTSUPP; -#ifdef CONFIG_UNICODE +#if IS_ENABLED(CONFIG_UNICODE) memcpy(&dirent->v.d_cf_name_block.d_names[0], name->name, name->len); char *cf_out = &dirent->v.d_cf_name_block.d_names[name->len]; diff --git a/fs/bcachefs/dirent.h b/fs/bcachefs/dirent.h index 0417608c18d5..2675da3e3860 100644 --- a/fs/bcachefs/dirent.h +++ b/fs/bcachefs/dirent.h @@ -23,7 +23,7 @@ struct bch_fs; struct bch_hash_info; struct bch_inode_info; -#ifdef CONFIG_UNICODE +#if IS_ENABLED(CONFIG_UNICODE) int bch2_casefold(struct btree_trans *, const struct bch_hash_info *, const struct qstr *, struct qstr *); #else diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index e54e4f255b22..cd8347063e80 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -2563,7 +2563,7 @@ got_sb: sb->s_shrink->seeks = 0; -#ifdef CONFIG_UNICODE +#if IS_ENABLED(CONFIG_UNICODE) if (bch2_fs_casefold_enabled(c)) sb->s_encoding = c->cf_encoding; generic_set_sb_d_ops(sb); diff --git a/fs/bcachefs/inode.c b/fs/bcachefs/inode.c index ef4cc7395b86..6e08c7a26f4d 100644 --- a/fs/bcachefs/inode.c +++ b/fs/bcachefs/inode.c @@ -1265,7 +1265,7 @@ int bch2_inode_set_casefold(struct btree_trans *trans, subvol_inum inum, { struct bch_fs *c = trans->c; -#ifndef CONFIG_UNICODE +#if !IS_ENABLED(CONFIG_UNICODE) bch_err(c, "Cannot use casefolding on a kernel without CONFIG_UNICODE"); return -EOPNOTSUPP; #endif diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index c46b1053a02c..5e90f64bd5f4 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -585,7 +585,7 @@ static void __bch2_fs_free(struct bch_fs *c) for (unsigned i = 0; i < BCH_TIME_STAT_NR; i++) bch2_time_stats_exit(&c->times[i]); -#ifdef CONFIG_UNICODE +#if IS_ENABLED(CONFIG_UNICODE) utf8_unload(c->cf_encoding); #endif @@ -1024,7 +1024,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts *opts, goto err; } -#ifdef CONFIG_UNICODE +#if IS_ENABLED(CONFIG_UNICODE) if (bch2_fs_casefold_enabled(c)) { /* Default encoding until we can potentially have more as an option. */ c->cf_encoding = utf8_load(BCH_FS_DEFAULT_UTF8_ENCODING); |