projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2be7828
)
buffer: a small optimization in grow_buffers
author
Mikulas Patocka
<mpatocka@redhat.com>
Mon, 22 Mar 2021 14:05:05 +0000
(10:05 -0400)
committer
Al Viro
<viro@zeniv.linux.org.uk>
Mon, 22 Mar 2021 15:30:03 +0000
(11:30 -0400)
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>
fs/buffer.c
patch
|
blob
|
history
diff --git
a/fs/buffer.c
b/fs/buffer.c
index 0cb7ffd4977c9283aba3794f4da84ecb1758ec47..c2e052c0fc5d6a3190443049192ce5941ff6ff14 100644
(file)
--- 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;
/*