diff options
author | Adam Borowski <kilobyte@angband.pl> | 2018-10-18 02:20:19 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2018-10-18 02:20:19 -0400 |
commit | dddde68b8f06dd83486124b8d245e7bfb15c185d (patch) | |
tree | 205c8d68e7c252672a19de2e9e4ce69c81d5b918 | |
parent | 4831822ff12e9f2bc084da892045551fdf3d112c (diff) |
xfs: add a define for statfs magic to uapi
Needed by userspace programs that call fstatfs().
It'd be natural to publish XFS_SB_MAGIC in uapi, but while these two
have identical values, they have different semantic meaning: one is
an enum cookie meant for statfs, the other a signature of the
on-disk format.
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r-- | fs/xfs/xfs_super.c | 5 | ||||
-rw-r--r-- | include/uapi/linux/magic.h | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 99250bcb65a7..d3e6cd063688 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <linux/dax.h> | 43 | #include <linux/dax.h> |
44 | #include <linux/init.h> | 44 | #include <linux/init.h> |
45 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
46 | #include <linux/magic.h> | ||
46 | #include <linux/mount.h> | 47 | #include <linux/mount.h> |
47 | #include <linux/mempool.h> | 48 | #include <linux/mempool.h> |
48 | #include <linux/writeback.h> | 49 | #include <linux/writeback.h> |
@@ -1128,7 +1129,7 @@ xfs_fs_statfs( | |||
1128 | xfs_extlen_t lsize; | 1129 | xfs_extlen_t lsize; |
1129 | int64_t ffree; | 1130 | int64_t ffree; |
1130 | 1131 | ||
1131 | statp->f_type = XFS_SB_MAGIC; | 1132 | statp->f_type = XFS_SUPER_MAGIC; |
1132 | statp->f_namelen = MAXNAMELEN - 1; | 1133 | statp->f_namelen = MAXNAMELEN - 1; |
1133 | 1134 | ||
1134 | id = huge_encode_dev(mp->m_ddev_targp->bt_dev); | 1135 | id = huge_encode_dev(mp->m_ddev_targp->bt_dev); |
@@ -1681,7 +1682,7 @@ xfs_fs_fill_super( | |||
1681 | * we must configure the block size in the superblock before we run the | 1682 | * we must configure the block size in the superblock before we run the |
1682 | * full mount process as the mount process can lookup and cache inodes. | 1683 | * full mount process as the mount process can lookup and cache inodes. |
1683 | */ | 1684 | */ |
1684 | sb->s_magic = XFS_SB_MAGIC; | 1685 | sb->s_magic = XFS_SUPER_MAGIC; |
1685 | sb->s_blocksize = mp->m_sb.sb_blocksize; | 1686 | sb->s_blocksize = mp->m_sb.sb_blocksize; |
1686 | sb->s_blocksize_bits = ffs(sb->s_blocksize) - 1; | 1687 | sb->s_blocksize_bits = ffs(sb->s_blocksize) - 1; |
1687 | sb->s_maxbytes = xfs_max_file_offset(sb->s_blocksize_bits); | 1688 | sb->s_maxbytes = xfs_max_file_offset(sb->s_blocksize_bits); |
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h index 1a6fee974116..96c24478d8ce 100644 --- a/include/uapi/linux/magic.h +++ b/include/uapi/linux/magic.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #define HPFS_SUPER_MAGIC 0xf995e849 | 29 | #define HPFS_SUPER_MAGIC 0xf995e849 |
30 | #define ISOFS_SUPER_MAGIC 0x9660 | 30 | #define ISOFS_SUPER_MAGIC 0x9660 |
31 | #define JFFS2_SUPER_MAGIC 0x72b6 | 31 | #define JFFS2_SUPER_MAGIC 0x72b6 |
32 | #define XFS_SUPER_MAGIC 0x58465342 /* "XFSB" */ | ||
32 | #define PSTOREFS_MAGIC 0x6165676C | 33 | #define PSTOREFS_MAGIC 0x6165676C |
33 | #define EFIVARFS_MAGIC 0xde5e81e4 | 34 | #define EFIVARFS_MAGIC 0xde5e81e4 |
34 | #define HOSTFS_SUPER_MAGIC 0x00c0ffee | 35 | #define HOSTFS_SUPER_MAGIC 0x00c0ffee |