diff options
author | Vignesh Babu <vignesh.babu@wipro.com> | 2007-06-28 02:46:37 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-07-14 01:37:12 -0400 |
commit | 16a087d8e1af9b974125870dceb9e4a35249ad1d (patch) | |
tree | 259314c4fc03782a2792a93bc5fd25cce5277c56 /fs/xfs | |
parent | bbaaf53808c778bda24f8245a440c5ceacc1a37d (diff) |
[XFS] Use is_power_of_2 instead of open coding checks
SGI-PV: 966576
SGI-Modid: xfs-linux-melb:xfs-kern:28950a
Signed-off-by: Vignesh Babu <vignesh.babu@wipro.com>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 3ca5d43b8345..8fdd30d9ba56 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include "xfs_quota.h" | 49 | #include "xfs_quota.h" |
50 | #include "xfs_acl.h" | 50 | #include "xfs_acl.h" |
51 | 51 | ||
52 | #include <linux/log2.h> | ||
52 | 53 | ||
53 | kmem_zone_t *xfs_ifork_zone; | 54 | kmem_zone_t *xfs_ifork_zone; |
54 | kmem_zone_t *xfs_inode_zone; | 55 | kmem_zone_t *xfs_inode_zone; |
@@ -4184,7 +4185,7 @@ xfs_iext_realloc_direct( | |||
4184 | ifp->if_bytes = new_size; | 4185 | ifp->if_bytes = new_size; |
4185 | return; | 4186 | return; |
4186 | } | 4187 | } |
4187 | if ((new_size & (new_size - 1)) != 0) { | 4188 | if (!is_power_of_2(new_size)){ |
4188 | rnew_size = xfs_iroundup(new_size); | 4189 | rnew_size = xfs_iroundup(new_size); |
4189 | } | 4190 | } |
4190 | if (rnew_size != ifp->if_real_bytes) { | 4191 | if (rnew_size != ifp->if_real_bytes) { |
@@ -4207,7 +4208,7 @@ xfs_iext_realloc_direct( | |||
4207 | */ | 4208 | */ |
4208 | else { | 4209 | else { |
4209 | new_size += ifp->if_bytes; | 4210 | new_size += ifp->if_bytes; |
4210 | if ((new_size & (new_size - 1)) != 0) { | 4211 | if (!is_power_of_2(new_size)) { |
4211 | rnew_size = xfs_iroundup(new_size); | 4212 | rnew_size = xfs_iroundup(new_size); |
4212 | } | 4213 | } |
4213 | xfs_iext_inline_to_direct(ifp, rnew_size); | 4214 | xfs_iext_inline_to_direct(ifp, rnew_size); |