Commit 90432e60 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Al Viro

buffer: a small optimization in grow_buffers

This patch replaces a loop with a "tzcnt" instruction.
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 2be7828c
......@@ -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;
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment