lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231023013416.17246-1-gouhao@uniontech.com>
Date:   Mon, 23 Oct 2023 09:34:16 +0800
From:   Gou Hao <gouhao@...ontech.com>
To:     tytso@....edu, adilger.kernel@...ger.ca, jack@...e.cz,
        linux-ext4@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, gouhaojake@....com
Subject: [PATCH] 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' is equal in this case.

Signed-off-by: Gou Hao <gouhao@...ontech.com>
Signed-off-by: Gou Hao <gouhaojake@....com>
---
 fs/ext4/mballoc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 454d5612641e..8442f5474b25 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1456,9 +1456,7 @@ 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);
+	page = find_or_create_page(inode->i_mapping, ++block, gfp);
 	if (!page)
 		return -ENOMEM;
 	BUG_ON(page->mapping != inode->i_mapping);
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ