summaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2021-03-22 15:05:05 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2021-03-22 16:30:03 +0100
commit90432e600619cbd3f38ec817374a5db0caf1d600 (patch)
tree7f9057c56f719b3ecda444775e3594196452455c /fs/buffer.c
parentget rid of autofs_getpath() (diff)
downloadlinux-90432e600619cbd3f38ec817374a5db0caf1d600.tar.xz
linux-90432e600619cbd3f38ec817374a5db0caf1d600.zip
buffer: a small optimization in grow_buffers
This patch replaces a loop with a "tzcnt" instruction. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 0cb7ffd4977c..c2e052c0fc5d 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1020,11 +1020,7 @@ grow_buffers(struct block_device *bdev, sector_t block, int size, gfp_t gfp)
pgoff_t index;
int sizebits;
- sizebits = -1;
- do {
- sizebits++;
- } while ((size << sizebits) < PAGE_SIZE);
-
+ sizebits = PAGE_SHIFT - __ffs(size);
index = block >> sizebits;
/*