Skip to contentSkip to conversation

hugetlbfs: publish HUGETLBFS_MAGIC via linux/magic.h (updated)

PATCH New nick black 1 participant 1 message Jun 29, 2009 HugeTLB

lore
Share & tools
lore

nick black

author
#0 lore raw

PATCH 1/1 hugetlbfs: publish HUGETLBFS_MAGIC via linux/magic.h (updated)

statfs(2)'s man page (release 3.21) lists HUGETLBFS_MAGIC among other constants of its type (these #define's really ought perhaps become an enum, but that's another patch). It isn't actually exported, though; it's buried within inode.c in fs/hugetlbfs/. This patch updates the interface against documentation and expectation, bringing hugetlbfs support to statfs(2). Thanks to Pekka Enberg for feedback!

fs/hugetlbfs/inode.c +1 -3
diff -uprN -X linux-2.6.31-rc1-pristine/Documentation/dontdiff linux-2.6.31-rc1-pristine/fs/hugetlbfs/inode.c linux-2.6.31-rc1/fs/hugetlbfs/inode.c
@@ -31,12 +31,10 @@
 #include <linux/statfs.h>
 #include <linux/security.h>
 #include <linux/ima.h>
+#include <linux/magic.h>
 
 #include <asm/uaccess.h>
 
-/* some random number */
-#define HUGETLBFS_MAGIC	0x958458f6
-
 static const struct super_operations hugetlbfs_ops;
 static const struct address_space_operations hugetlbfs_aops;
 const struct file_operations hugetlbfs_file_operations;
include/linux/magic.h +1 -0
diff -uprN -X linux-2.6.31-rc1-pristine/Documentation/dontdiff linux-2.6.31-rc1-pristine/include/linux/magic.h linux-2.6.31-rc1/include/linux/magic.h
@@ -13,6 +13,7 @@
 #define SECURITYFS_MAGIC	0x73636673
 #define SELINUX_MAGIC		0xf97cff8c
 #define TMPFS_MAGIC		0x01021994
+#define HUGETLBFS_MAGIC 	0x958458f6	/* some random number */
 #define SQUASHFS_MAGIC		0x73717368
 #define EFS_SUPER_MAGIC		0x414A53
 #define EXT2_SUPER_MAGIC	0xEF53
Signature · 4 lines
                                      Nick Black <[email protected]>
                                             Principal Engineer, McAfee
                                  Grad student, GT College of Computing
                    "np: the class of dashed hopes, and idle dreams..."