]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
include/linux.h: use linux/magic.h to get XFS_SUPER_MAGIC
authorOjaswin Mujoo <ojaswin@linux.ibm.com>
Thu, 19 Dec 2024 12:39:13 +0000 (18:09 +0530)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 25 Dec 2024 21:14:45 +0000 (22:14 +0100)
This avoids open coding the magic number

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
include/linux.h

index e9eb7bfb26a13707e387f11e1b381a3d32b8cbb6..b3516d54c51b175325645e88ea26b13d01b48673 100644 (file)
@@ -37,6 +37,7 @@
 #endif
 #include <unistd.h>
 #include <assert.h>
+#include <linux/magic.h> /* super block magic numbers */
 
 static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
 {
@@ -60,7 +61,7 @@ static __inline__ int platform_test_xfs_fd(int fd)
                return 0;
        if (!S_ISREG(statbuf.st_mode) && !S_ISDIR(statbuf.st_mode))
                return 0;
-       return (statfsbuf.f_type == 0x58465342);        /* XFSB */
+       return statfsbuf.f_type == XFS_SUPER_MAGIC;
 }
 
 static __inline__ int platform_test_xfs_path(const char *path)