summaryrefslogtreecommitdiffstats
path: root/include/c.h
diff options
context:
space:
mode:
authorKarel Zak2010-10-15 01:33:28 +0200
committerKarel Zak2010-10-15 01:33:28 +0200
commit973af806428c0f853ac0241ab46faee6ccdaab26 (patch)
tree11842f1a0054c5fd867d56d64339e4fa87c90ee4 /include/c.h
parentlibblkid: consolidate magic strings detection code (diff)
downloadkernel-qcow2-util-linux-973af806428c0f853ac0241ab46faee6ccdaab26.tar.gz
kernel-qcow2-util-linux-973af806428c0f853ac0241ab46faee6ccdaab26.tar.xz
kernel-qcow2-util-linux-973af806428c0f853ac0241ab46faee6ccdaab26.zip
libblkid: fix MBR detection on iPod and cleanup vfat code
- move all FAT code to superblocks/vfat.c only - add a generic function to verify FAT superblock and use it in FAT prober as well as in MBR parser - add a more robust FAT cluster_count check (it seems that iPod contains an "almost valid" FAT superblock before MBR) Reported-by: Davidlohr Bueso <dave.bueso@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/c.h')
-rw-r--r--include/c.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/c.h b/include/c.h
index 577b8a809..bed8f5ba0 100644
--- a/include/c.h
+++ b/include/c.h
@@ -62,4 +62,10 @@
_max1 > _max2 ? _max1 : _max2; })
#endif
+static inline __attribute__((const)) int is_power_of_2(unsigned long num)
+{
+ return (num != 0 && ((num & (num - 1)) == 0));
+}
+
+
#endif /* UTIL_LINUX_C_H */