LE64_BITMASK(BCH_SB_ERASURE_CODE, struct bch_sb, flags[3], 0, 16);
LE64_BITMASK(BCH_SB_METADATA_TARGET, struct bch_sb, flags[3], 16, 28);
+LE64_BITMASK(BCH_SB_SHARD_INUMS, struct bch_sb, flags[3], 28, 29);
/*
* Features:
struct bkey_s_c k;
u64 min, max, start, pos, *hint;
int ret = 0;
+ unsigned bits = (c->opts.inodes_32bit ? 31 : 63);
- u64 cpu = raw_smp_processor_id();
- unsigned bits = (c->opts.inodes_32bit
- ? 31 : 63) - c->inode_shard_bits;
+ if (c->opts.shard_inode_numbers) {
+ u64 cpu = raw_smp_processor_id();
- min = (cpu << bits);
- max = (cpu << bits) | ~(ULLONG_MAX << bits);
+ bits -= c->inode_shard_bits;
- min = max_t(u64, min, BLOCKDEV_INODE_MAX);
- hint = c->unused_inode_hints + cpu;
+ min = (cpu << bits);
+ max = (cpu << bits) | ~(ULLONG_MAX << bits);
+
+ min = max_t(u64, min, BLOCKDEV_INODE_MAX);
+ hint = c->unused_inode_hints + cpu;
+ } else {
+ min = BLOCKDEV_INODE_MAX;
+ max = ~(ULLONG_MAX << bits);
+ hint = c->unused_inode_hints;
+ }
start = READ_ONCE(*hint);
x(inodes_32bit, u8, \
OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME, \
OPT_BOOL(), \
- BCH_SB_INODE_32BIT, false, \
+ BCH_SB_INODE_32BIT, true, \
NULL, "Constrain inode numbers to 32 bits") \
+ x(shard_inode_numbers, u8, \
+ OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME, \
+ OPT_BOOL(), \
+ BCH_SB_SHARD_INUMS, false, \
+ NULL, "Shard new inode numbers by CPU id") \
x(gc_reserve_percent, u8, \
OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME, \
OPT_UINT(5, 21), \