]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_io: add support for changing the new inode DAX attribute
authorDave Chinner <dchinner@redhat.com>
Mon, 15 Feb 2016 01:11:38 +0000 (12:11 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 15 Feb 2016 01:11:38 +0000 (12:11 +1100)
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
include/freebsd.h
include/irix.h
include/linux.h
io/attr.c

index 2baa5362746e53d093e12f0912d115a7681f037f..a52030d58d3999fc727a50f1478e32ea699f88b0 100644 (file)
@@ -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)
index fe567d4c707b0d1dc487ae4f610c77a2ca39710c..f7e0c758f45f2d1d5284ce650028f9e15732de76 100644 (file)
@@ -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)
index bdb4b6ad6c7559b6d7647f5dda9792b958ffd4f0..c2191eef8c987875ae4e5b972ffe094e0456cf36 100644 (file)
@@ -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
index 17391c3457afbc1cb0cf0be04d59d803c9a07d23..cc0f70ceed72406822885d878b939b3e66c03ffd 100644 (file)
@@ -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)
index 6fa08bfa2c68000a4e046f99679a8633d1169033..0186b1ddd2e406eb218aaf8708b4e033ab7e2442 100644 (file)
--- 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"