mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
ext4: delete redundant calculations in ext4_mb_get_buddy_page_lock()
'blocks_per_page' is always 1 after 'if (blocks_per_page >= 2)', 'pnum' and 'block' are equal in this case. Signed-off-by: Gou Hao <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
This commit is contained in:
+2
-3
@@ -1456,9 +1456,8 @@ static int ext4_mb_get_buddy_page_lock(struct super_block *sb,
|
||||
return 0;
|
||||
}
|
||||
|
||||
block++;
|
||||
pnum = block / blocks_per_page;
|
||||
page = find_or_create_page(inode->i_mapping, pnum, gfp);
|
||||
/* blocks_per_page == 1, hence we need another page for the buddy */
|
||||
page = find_or_create_page(inode->i_mapping, block + 1, gfp);
|
||||
if (!page)
|
||||
return -ENOMEM;
|
||||
BUG_ON(page->mapping != inode->i_mapping);
|
||||
|
||||
Reference in New Issue
Block a user