From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 61F267CB7 for ; Wed, 17 Feb 2016 16:53:41 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id 244D38F804B for ; Wed, 17 Feb 2016 14:53:41 -0800 (PST) Received: from mga11.intel.com ([192.55.52.93]) by cuda.sgi.com with ESMTP id K8mmra4uKt4Cwlzo for ; Wed, 17 Feb 2016 14:53:39 -0800 (PST) Date: Wed, 17 Feb 2016 15:53:23 -0700 From: Ross Zwisler Subject: Re: [PATCH 3/3] xfs_io: add support for changing the new inode DAX attribute Message-ID: <20160217225323.GC30126@linux.intel.com> References: <1455514346-15481-1-git-send-email-david@fromorbit.com> <1455514346-15481-4-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1455514346-15481-4-git-send-email-david@fromorbit.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Dave Chinner Cc: ross.zwisler@linux.intel.com, jack@suse.cz, xfs@oss.sgi.com On Mon, Feb 15, 2016 at 04:32:26PM +1100, Dave Chinner wrote: > From: Dave Chinner > > It is changed via the FS_IOC_FSSETXATTR ioctl, so add the new flag > to the platform definitions for userspace that don't this API. Then > add support to the relevant xfs_io chattr and stat commands. > > Signed-off-by: Dave Chinner Works for me. Tested-by: Ross Zwisler > --- > include/darwin.h | 1 + > include/freebsd.h | 1 + > include/irix.h | 1 + > include/linux.h | 1 + > io/attr.c | 5 ++++- > 5 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/include/darwin.h b/include/darwin.h > index 2baa536..a52030d 100644 > --- a/include/darwin.h > +++ b/include/darwin.h > @@ -312,6 +312,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > diff --git a/include/freebsd.h b/include/freebsd.h > index fe567d4..f7e0c75 100644 > --- a/include/freebsd.h > +++ b/include/freebsd.h > @@ -202,6 +202,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > diff --git a/include/irix.h b/include/irix.h > index bdb4b6a..c2191ee 100644 > --- a/include/irix.h > +++ b/include/irix.h > @@ -447,6 +447,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR F_FSGETXATTR > diff --git a/include/linux.h b/include/linux.h > index 17391c3..cc0f70c 100644 > --- a/include/linux.h > +++ b/include/linux.h > @@ -205,6 +205,7 @@ struct fsxattr { > #define FS_XFLAG_EXTSZINHERIT 0x00001000 /* inherit inode extent size */ > #define FS_XFLAG_NODEFRAG 0x00002000 /* do not defragment */ > #define FS_XFLAG_FILESTREAM 0x00004000 /* use filestream allocator */ > +#define FS_XFLAG_DAX 0x00008000 /* use DAX for IO */ > #define FS_XFLAG_HASATTR 0x80000000 /* no DIFLAG for this */ > > #define FS_IOC_FSGETXATTR _IOR ('X', 31, struct fsxattr) > diff --git a/io/attr.c b/io/attr.c > index 6fa08bf..0186b1d 100644 > --- a/io/attr.c > +++ b/io/attr.c > @@ -47,9 +47,10 @@ static struct xflags { > { FS_XFLAG_EXTSZINHERIT, "E", "extsz-inherit" }, > { FS_XFLAG_NODEFRAG, "f", "no-defrag" }, > { FS_XFLAG_FILESTREAM, "S", "filestream" }, > + { FS_XFLAG_DAX, "x", "dax" }, > { 0, NULL, NULL } > }; > -#define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfS" > +#define CHATTR_XFLAG_LIST "r"/*p*/"iasAdtPneEfSx" > > static void > lsattr_help(void) > @@ -73,6 +74,7 @@ lsattr_help(void) > " E -- children created in this directory inherit the extent size value\n" > " f -- do not include this file when defragmenting the filesystem\n" > " S -- enable filestreams allocator for this directory\n" > +" x -- Use direct access (DAX) for data in this file\n" > "\n" > " Options:\n" > " -R -- recursively descend (useful when current file is a directory)\n" > @@ -108,6 +110,7 @@ chattr_help(void) > " +/-E -- set/clear the extent-size inheritance flag\n" > " +/-f -- set/clear the no-defrag flag\n" > " +/-S -- set/clear the filestreams allocator flag\n" > +" +/-x -- set/clear the direct access (DAX) flag\n" > " Note1: user must have certain capabilities to modify immutable/append-only.\n" > " Note2: immutable/append-only files cannot be deleted; removing these files\n" > " requires the immutable/append-only flag to be cleared first.\n" > -- > 2.5.0 > _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs