ext4: replace the traditional ternary conditional operator with with max()/min()
[ Upstream commit de8bf0e5ee7482585450357c6d4eddec8efc5cb7 ] Replace the traditional ternary conditional operator with with max()/min() Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Link: https://lore.kernel.org/r/20230801143204.2284343-7-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Stable-dep-of: 45e4ab320c9b ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
cbf6a0f654
commit
e78e9f08a2
@@ -5902,8 +5902,7 @@ static int ext4_try_to_trim_range(struct super_block *sb,
|
|||||||
void *bitmap;
|
void *bitmap;
|
||||||
|
|
||||||
bitmap = e4b->bd_bitmap;
|
bitmap = e4b->bd_bitmap;
|
||||||
start = (e4b->bd_info->bb_first_free > start) ?
|
start = max(e4b->bd_info->bb_first_free, start);
|
||||||
e4b->bd_info->bb_first_free : start;
|
|
||||||
count = 0;
|
count = 0;
|
||||||
free_count = 0;
|
free_count = 0;
|
||||||
|
|
||||||
@@ -6125,8 +6124,7 @@ ext4_mballoc_query_range(
|
|||||||
|
|
||||||
ext4_lock_group(sb, group);
|
ext4_lock_group(sb, group);
|
||||||
|
|
||||||
start = (e4b.bd_info->bb_first_free > start) ?
|
start = max(e4b.bd_info->bb_first_free, start);
|
||||||
e4b.bd_info->bb_first_free : start;
|
|
||||||
if (end >= EXT4_CLUSTERS_PER_GROUP(sb))
|
if (end >= EXT4_CLUSTERS_PER_GROUP(sb))
|
||||||
end = EXT4_CLUSTERS_PER_GROUP(sb) - 1;
|
end = EXT4_CLUSTERS_PER_GROUP(sb) - 1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user