[XFS] Use is_power_of_2 instead of open coding checks
authorVignesh Babu <vignesh.babu@wipro.com>
Thu, 28 Jun 2007 06:46:37 +0000 (16:46 +1000)
committerTim Shimmin <tes@chook.melbourne.sgi.com>
Sat, 14 Jul 2007 05:37:12 +0000 (15:37 +1000)
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>
fs/xfs/xfs_inode.c

index 3ca5d43b83456ccdf8ca4c61f13b363d13c9e76c..8fdd30d9ba56424791be59bafc804844ffa6d95c 100644 (file)
@@ -49,6 +49,7 @@
 #include "xfs_quota.h"
 #include "xfs_acl.h"
 
+#include <linux/log2.h>
 
 kmem_zone_t *xfs_ifork_zone;
 kmem_zone_t *xfs_inode_zone;
@@ -4184,7 +4185,7 @@ xfs_iext_realloc_direct(
                        ifp->if_bytes = new_size;
                        return;
                }
-               if ((new_size & (new_size - 1)) != 0) {
+               if (!is_power_of_2(new_size)){
                        rnew_size = xfs_iroundup(new_size);
                }
                if (rnew_size != ifp->if_real_bytes) {
@@ -4207,7 +4208,7 @@ xfs_iext_realloc_direct(
         */
        else {
                new_size += ifp->if_bytes;
-               if ((new_size & (new_size - 1)) != 0) {
+               if (!is_power_of_2(new_size)) {
                        rnew_size = xfs_iroundup(new_size);
                }
                xfs_iext_inline_to_direct(ifp, rnew_size);