diff options
author | Harshad Shirwadkar <harshadshirwadkar@gmail.com> | 2021-04-01 10:21:26 -0700 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-04-09 11:34:59 -0400 |
commit | 4b68f6df105966f04f45f1eca0561b86f2b3551d (patch) | |
tree | 42ded997cc4aff8cd5c5404ebcd118bdccc3e492 /fs/ext4/mballoc.h | |
parent | a6c75eaf11032f4a3d2b3ce2265a194ac6e4a7f0 (diff) |
ext4: add MB_NUM_ORDERS macro
A few arrays in mballoc.c use the total number of valid orders as
their size. Currently, this value is set as "sb->s_blocksize_bits +
2". This makes code harder to read. So, instead add a new macro
MB_NUM_ORDERS(sb) to make the code more readable.
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Reviewed-by: Ritesh Harjani <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20210401172129.189766-5-harshadshirwadkar@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.h')
-rw-r--r-- | fs/ext4/mballoc.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ext4/mballoc.h b/fs/ext4/mballoc.h index e75b4749aa1c..68111a10cfee 100644 --- a/fs/ext4/mballoc.h +++ b/fs/ext4/mballoc.h @@ -78,6 +78,11 @@ */ #define MB_DEFAULT_MAX_INODE_PREALLOC 512 +/* + * Number of valid buddy orders + */ +#define MB_NUM_ORDERS(sb) ((sb)->s_blocksize_bits + 2) + struct ext4_free_data { /* this links the free block information from sb_info */ struct list_head efd_list; |