From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: [PATCH 02/22] xfs: add XFS_SUPER_MAGIC to Date: Tue, 4 Mar 2014 22:10:35 +1100 Message-ID: <20140304111035.GE6851@dastard> References: <1393927258-10709-1-git-send-email-kzak@redhat.com> <1393927258-10709-3-git-send-email-kzak@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Al Viro , linux-fsdevel@vger.kernel.org To: Karel Zak Return-path: Received: from ipmail07.adl2.internode.on.net ([150.101.137.131]:2714 "EHLO ipmail07.adl2.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756650AbaCDLS4 (ORCPT ); Tue, 4 Mar 2014 06:18:56 -0500 Content-Disposition: inline In-Reply-To: <1393927258-10709-3-git-send-email-kzak@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 > Signed-off-by: Karel Zak > --- > 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 > + > /* > * 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@fromorbit.com