public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Cc: ross.zwisler@linux.intel.com, jack@suse.cz
Subject: [PATCH 3/3] xfs_io: add support for changing the new inode DAX attribute
Date: Mon, 15 Feb 2016 16:32:26 +1100	[thread overview]
Message-ID: <1455514346-15481-4-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1455514346-15481-1-git-send-email-david@fromorbit.com>

From: Dave Chinner <dchinner@redhat.com>

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 <dchinner@redhat.com>
---
 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

  parent reply	other threads:[~2016-02-15  5:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15  5:32 [PATCH 0/3] xfsprogs: FS_IOC_FS[SG]ETXATTR and DAX support Dave Chinner
2016-02-15  5:32 ` [PATCH 1/3] xfs_fs.h: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion Dave Chinner
2016-02-15 23:43   ` Eric Sandeen
2016-02-15  5:32 ` [PATCH 2/3] xfs: introduce per-inode DAX enablement Dave Chinner
2016-02-15 23:44   ` Eric Sandeen
2016-02-15  5:32 ` Dave Chinner [this message]
2016-02-15 23:46   ` [PATCH 3/3] xfs_io: add support for changing the new inode DAX attribute Eric Sandeen
2016-02-17 22:53   ` Ross Zwisler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455514346-15481-4-git-send-email-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=jack@suse.cz \
    --cc=ross.zwisler@linux.intel.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox