-#define BCH_OPT(_name, _choices, _min, _max, _sb_opt, _perm) \
- if (attr == &sysfs_opt_##_name) { \
- ssize_t v = (_choices == bch_bool_opt || \
- _choices == bch_uint_opt) \
- ? strtoul_restrict_or_return(buf, _min, _max - 1)\
- : bch_read_string_list(buf, _choices); \
- \
- if (v < 0) \
- return v; \
- \
- mutex_lock(&c->sb_lock); \
- if (attr == &sysfs_opt_compression) { \
- int ret = bch_check_set_has_compressed_data(c, v);\
- if (ret) { \
- mutex_unlock(&c->sb_lock); \
- return ret; \
- } \
- } \
- \
- if (_sb_opt##_BITS && v != _sb_opt(c->disk_sb)) { \
- SET_##_sb_opt(c->disk_sb, v); \
- bch_write_super(c); \
- } \
- \
- c->opts._name = v; \
- mutex_unlock(&c->sb_lock); \
- \
- return size; \
+ if (id == Opt_compression) {
+ int ret = bch_check_set_has_compressed_data(c, v);
+ if (ret) {
+ mutex_unlock(&c->sb_lock);
+ return ret;
+ }