Commit d42dd4ad authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: merge BCH_INODE_FIELDS_INHERIT/BCH_INODE_OPTS

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent a3e70fb2
......@@ -716,16 +716,17 @@ struct bch_inode_generation {
x(bi_background_target, 16) \
x(bi_erasure_code, 16)
#define BCH_INODE_FIELDS_INHERIT() \
x(bi_data_checksum) \
x(bi_compression) \
x(bi_project) \
x(bi_background_compression) \
x(bi_data_replicas) \
x(bi_promote_target) \
x(bi_foreground_target) \
x(bi_background_target) \
x(bi_erasure_code)
/* subset of BCH_INODE_FIELDS */
#define BCH_INODE_OPTS() \
x(data_checksum, 8) \
x(compression, 8) \
x(project, 32) \
x(background_compression, 8) \
x(data_replicas, 8) \
x(promote_target, 16) \
x(foreground_target, 16) \
x(background_target, 16) \
x(erasure_code, 16)
enum {
/*
......
......@@ -265,8 +265,8 @@ void bch2_inode_init(struct bch_fs *c, struct bch_inode_unpacked *inode_u,
inode_u->bi_otime = now;
if (parent) {
#define x(_name) inode_u->_name = parent->_name;
BCH_INODE_FIELDS_INHERIT()
#define x(_name, ...) inode_u->bi_##_name = parent->bi_##_name;
BCH_INODE_OPTS()
#undef x
}
}
......
......@@ -188,7 +188,10 @@ enum opt_type {
NO_SB_OPT, false) \
BCH_OPT(version_upgrade, u8, OPT_MOUNT, \
OPT_BOOL(), \
NO_SB_OPT, false)
NO_SB_OPT, false) \
BCH_OPT(project, u8, OPT_INTERNAL, \
OPT_BOOL(), \
NO_SB_OPT, false) \
struct bch_opts {
#define BCH_OPT(_name, _bits, ...) unsigned _name##_defined:1;
......@@ -281,16 +284,6 @@ int bch2_parse_mount_opts(struct bch_opts *, char *);
/* inode opts: */
#define BCH_INODE_OPTS() \
x(data_checksum, 8) \
x(compression, 8) \
x(background_compression, 8) \
x(data_replicas, 8) \
x(promote_target, 16) \
x(foreground_target, 16) \
x(background_target, 16) \
x(erasure_code, 16)
struct bch_io_opts {
#define x(_name, _bits) unsigned _name##_defined:1;
BCH_INODE_OPTS()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment