]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ext4: use in_range() for range checking in ext4_fc_replay_check_excluded
authorRitesh Harjani <riteshh@linux.ibm.com>
Wed, 16 Feb 2022 07:02:46 +0000 (12:32 +0530)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 26 Feb 2022 02:34:56 +0000 (21:34 -0500)
Instead of open coding it, use in_range() function instead.

Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/8e5526ef14150778871ac7c937c8993c6a09cd3e.1644992610.git.riteshh@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/fast_commit.c

index 7964ee34e322af3390256d6f4812793f65475663..3c5baca38767b3f56efa99ad6940efd20ffbcf4a 100644 (file)
@@ -1875,8 +1875,8 @@ bool ext4_fc_replay_check_excluded(struct super_block *sb, ext4_fsblk_t blk)
                if (state->fc_regions[i].ino == 0 ||
                        state->fc_regions[i].len == 0)
                        continue;
-               if (blk >= state->fc_regions[i].pblk &&
-                   blk < state->fc_regions[i].pblk + state->fc_regions[i].len)
+               if (in_range(blk, state->fc_regions[i].pblk,
+                                       state->fc_regions[i].len))
                        return true;
        }
        return false;