summaryrefslogtreecommitdiff
path: root/fs/btrfs/compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/compat.h')
-rw-r--r--fs/btrfs/compat.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/compat.h b/fs/btrfs/compat.h
index 12fb9f803c..be4f4e7a70 100644
--- a/fs/btrfs/compat.h
+++ b/fs/btrfs/compat.h
@@ -68,4 +68,9 @@ static inline void uuid_unparse(const u8 *uuid, char *out)
return uuid_bin_to_str((unsigned char *)uuid, out, 0);
}
+static inline int is_power_of_2(unsigned long n)
+{
+ return (n != 0 && ((n & (n - 1)) == 0));
+}
+
#endif