Re: [PATCH 02/22] xfs: add XFS_SUPER_MAGIC to <linux/magic.h>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 04, 2014 at 11:00:38AM +0100, Karel Zak wrote:
> Move the magic number to proper place as it's exported by
> statfs.f_type to userspace.

It is in it's proper place. It's an on-disk definition not a
userspace API definition. So, for the reasons I've already
outlined w.r.t. to coupling userspace APIs and on-disk format
definitions being Bad Thing, NACK.

> CC: Dave Chinner <david@xxxxxxxxxxxxx>
> Signed-off-by: Karel Zak <kzak@xxxxxxxxxx>
> ---
>  fs/xfs/xfs_sb.h            | 4 +++-
>  include/uapi/linux/magic.h | 1 +
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_sb.h b/fs/xfs/xfs_sb.h
> index 35061d4..e4c44fa 100644
> --- a/fs/xfs/xfs_sb.h
> +++ b/fs/xfs/xfs_sb.h
> @@ -18,6 +18,8 @@
>  #ifndef __XFS_SB_H__
>  #define	__XFS_SB_H__
>  
> +#include <linux/magic.h>
> +
>  /*
>   * Super block
>   * Fits into a sector-sized buffer at address 0 of each allocation group.
> @@ -28,7 +30,7 @@ struct xfs_buf;
>  struct xfs_mount;
>  struct xfs_trans;
>  
> -#define	XFS_SB_MAGIC		0x58465342	/* 'XFSB' */
> +#define	XFS_SB_MAGIC		XFS_SUPER_MAGIC	/* see linux/magic.h */
>  #define	XFS_SB_VERSION_1	1		/* 5.3, 6.0.1, 6.1 */
>  #define	XFS_SB_VERSION_2	2		/* 6.2 - attributes */
>  #define	XFS_SB_VERSION_3	3		/* 6.2 - new inode version */

FYI, this file (along with all the other on-disk format definitions
and the core XFS code to read, modify and write it) is shared with
the userspace xfsprogs code, so it needs the on-disk magic number to
be defined in this file. It also means we don't include random
header files from within other header files - we use explicit
includes in the .c files or, for generic headers needed everywhere,
consolidate them in fs/xfs/xfs_linux.h.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux