projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1683098
)
libxfs: Optimize the loop for xfs_bitmap_empty
author
Jia He
<hejianet@gmail.com>
Mon, 4 Jan 2016 05:10:19 +0000
(16:10 +1100)
committer
Dave Chinner
<david@fromorbit.com>
Mon, 4 Jan 2016 05:10:19 +0000
(16:10 +1100)
If there is any non zero bit in a long bitmap, it can jump out of the
loop and finish the function as soon as possible.
Signed-off-by: Jia He <hejianet@gmail.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_bit.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/xfs/libxfs/xfs_bit.c
b/fs/xfs/libxfs/xfs_bit.c
index 0e8885a596463e9e6d249974d271a234c420057c..0a94cce5ea356bd5a22be0ea6003434998510bf2 100644
(file)
--- a/
fs/xfs/libxfs/xfs_bit.c
+++ b/
fs/xfs/libxfs/xfs_bit.c
@@
-32,13
+32,13
@@
int
xfs_bitmap_empty(uint *map, uint size)
{
uint i;
- uint ret = 0;
for (i = 0; i < size; i++) {
- ret |= map[i];
+ if (map[i] != 0)
+ return 0;
}
- return
(ret == 0)
;
+ return
1
;
}
/*