diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2021-03-22 10:05:05 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2021-03-22 11:30:03 -0400 |
commit | 90432e600619cbd3f38ec817374a5db0caf1d600 (patch) | |
tree | 7f9057c56f719b3ecda444775e3594196452455c /fs/buffer.c | |
parent | 2be7828c9fefc8cd205d1948faac48da8ce6c2ef (diff) |
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.c | 6 |
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; /* |