]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ext4: remove dead check in mb_buddy_mark_free
authorKemeng Shi <shikemeng@huaweicloud.com>
Fri, 3 Mar 2023 17:21:12 +0000 (01:21 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Apr 2023 05:13:11 +0000 (01:13 -0400)
We always adjust first to even number and adjust last to odd number, so
first == last will never happen. Remove this dead check.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Link: https://lore.kernel.org/r/20230303172120.3800725-13-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c

index 65dac09c4cea2a546c4907d5fdee50220427173a..591bd8e5e5c7be90c223f2fb9200600a4d2fc351 100644 (file)
@@ -1718,7 +1718,8 @@ static void mb_buddy_mark_free(struct ext4_buddy *e4b, int first, int last)
                        break;
                order++;
 
-               if (first == last || !(buddy2 = mb_find_buddy(e4b, order, &max))) {
+               buddy2 = mb_find_buddy(e4b, order, &max);
+               if (!buddy2) {
                        mb_clear_bits(buddy, first, last - first + 1);
                        e4b->bd_info->bb_counters[order - 1] += last - first + 1;
                        break;