X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=fs%2Fext4%2Fmballoc.c;h=49e444b51a0c8044108036811d1ea43716516f87;hb=b5cb316cdf3a3f5f6125412b0f6065185240cfdc;hp=efa111a7606dd13d62215694d5a2278a1cfd50c0;hpb=74177f55b70e2f2be770dd28684dd6d17106a4ba;p=mirror_ubuntu-bionic-kernel.git diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index efa111a7606d..49e444b51a0c 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1266,6 +1266,7 @@ static void ext4_mb_unload_buddy(struct ext4_buddy *e4b) static int mb_find_order_for_block(struct ext4_buddy *e4b, int block) { int order = 1; + int bb_incr = 1 << (e4b->bd_blkbits - 1); void *bb; BUG_ON(e4b->bd_bitmap == e4b->bd_buddy); @@ -1278,7 +1279,8 @@ static int mb_find_order_for_block(struct ext4_buddy *e4b, int block) /* this block is part of buddy of order 'order' */ return order; } - bb += 1 << (e4b->bd_blkbits - order); + bb += bb_incr; + bb_incr >>= 1; order++; } return 0;