diff options
author | Ojaswin Mujoo <ojaswin@linux.ibm.com> | 2023-06-30 14:29:27 +0530 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-08-03 10:39:05 -0400 |
commit | 304749c0d5e216479ea4d553ad04ba1390d5c707 (patch) | |
tree | d2fe3197e466041d1dbc0ea06c67462bb3da139f /fs/ext4/ext4.h | |
parent | 1e1566b9c85fbd6150657ea17f50fd42b9166d31 (diff) | |
download | lwn-304749c0d5e216479ea4d553ad04ba1390d5c707.tar.gz lwn-304749c0d5e216479ea4d553ad04ba1390d5c707.zip |
ext4: replace CR_FAST macro with inline function for readability
Replace CR_FAST with ext4_mb_cr_expensive() inline function for better
readability. This function returns true if the criteria is one of the
expensive/slower ones where lots of disk IO/prefetching is acceptable.
No functional changes are intended in this patch.
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20230630085927.140137-1-ojaswin@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 89d76d50af4c..532b70f613e9 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -176,9 +176,6 @@ enum criteria { EXT4_MB_NUM_CRS }; -/* criteria below which we use fast block scanning and avoid unnecessary IO */ -#define CR_FAST CR_GOAL_LEN_SLOW - /* * Flags used in mballoc's allocation_context flags field. * @@ -2924,6 +2921,10 @@ extern int ext4_trim_fs(struct super_block *, struct fstrim_range *); extern void ext4_process_freed_data(struct super_block *sb, tid_t commit_tid); extern void ext4_mb_mark_bb(struct super_block *sb, ext4_fsblk_t block, int len, int state); +static inline bool ext4_mb_cr_expensive(enum criteria cr) +{ + return cr >= CR_GOAL_LEN_SLOW; +} /* inode.c */ void ext4_inode_csum_set(struct inode *inode, struct ext4_inode *raw, |