On 2018/11/28 上午3:53, David Sterba wrote: > This is motivated by a merging mistake that happened a few releases ago. > Two patches updated BTRFS_FS_* flags independently to the same value, > git did not see any direct merge conflict. The two values got mixed at > runtime and caused crash. > > Update all #define sequential values, the above merging problem would > not happen as there would be a conflict and the enum value > auto-increment would prevent duplicated values anyway. Just one small question for the bitmap usage. For enum we won't directly know the last number is, my concern is if we're using u16 as bitmap and there is some enum over 15, will we get a warning at compile time or some bug would just sneak into kernel? Thanks, Qu > > David Sterba (9): > btrfs: switch BTRFS_FS_STATE_* to enums > btrfs: switch BTRFS_BLOCK_RSV_* to enums > btrfs: switch BTRFS_FS_* to enums > btrfs: switch BTRFS_ROOT_* to enums > btrfs: swtich EXTENT_BUFFER_* to enums > btrfs: switch EXTENT_FLAG_* to enums > btrfs: switch BTRFS_*_LOCK to enums > btrfs: switch BTRFS_ORDERED_* to enums > btrfs: drop extra enum initialization where using defaults > > fs/btrfs/btrfs_inode.h | 2 +- > fs/btrfs/ctree.h | 168 ++++++++++++++++++++++------------------ > fs/btrfs/disk-io.h | 10 +-- > fs/btrfs/extent_io.h | 28 ++++--- > fs/btrfs/extent_map.h | 21 +++-- > fs/btrfs/locking.h | 10 ++- > fs/btrfs/ordered-data.h | 45 ++++++----- > fs/btrfs/qgroup.h | 2 +- > fs/btrfs/sysfs.h | 2 +- > fs/btrfs/transaction.h | 14 ++-- > 10 files changed, 169 insertions(+), 133 deletions(-) >