diff mbox series

[4/7] xfs_io: implement lsattr and chattr support for forcealign

Message ID 20230929095342.2976587-5-john.g.garry@oracle.com (mailing list archive)
State New, archived
Headers show
Series xfsprogs: Enable extent forcealign feature | expand

Commit Message

John Garry Sept. 29, 2023, 9:53 a.m. UTC
From: "Darrick J. Wong" <djwong@kernel.org>

Make it so that we can adjust the forcealign flag at runtime.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Co-developed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
 io/attr.c                       | 5 ++++-
 man/man2/ioctl_xfs_fsgetxattr.2 | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/io/attr.c b/io/attr.c
index fd82a2e73801..248a9c28eae1 100644
--- a/io/attr.c
+++ b/io/attr.c
@@ -38,9 +38,10 @@  static struct xflags {
 	{ FS_XFLAG_DAX,			"x", "dax"		},
 	{ FS_XFLAG_COWEXTSIZE,		"C", "cowextsize"	},
 	{ FS_XFLAG_HASATTR,		"X", "has-xattr"	},
+	{ FS_XFLAG_FORCEALIGN,		"F", "force-align"	},
 	{ 0, NULL, NULL }
 };
-#define CHATTR_XFLAG_LIST	"r"/*p*/"iasAdtPneEfSxC"/*X*/
+#define CHATTR_XFLAG_LIST	"r"/*p*/"iasAdtPneEfSxC"/*X*/"F"
 
 static void
 lsattr_help(void)
@@ -67,6 +68,7 @@  lsattr_help(void)
 " x -- Use direct access (DAX) for data in this file\n"
 " C -- for files with shared blocks, observe the inode CoW extent size value\n"
 " X -- file has extended attributes (cannot be changed using chattr)\n"
+" F -- data extent mappings must be aligned to extent size hint\n"
 "\n"
 " Options:\n"
 " -R -- recursively descend (useful when current file is a directory)\n"
@@ -104,6 +106,7 @@  chattr_help(void)
 " +/-S -- set/clear the filestreams allocator flag\n"
 " +/-x -- set/clear the direct access (DAX) flag\n"
 " +/-C -- set/clear the CoW extent-size flag\n"
+" +/-F -- set/clear the forcealign 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"
diff --git a/man/man2/ioctl_xfs_fsgetxattr.2 b/man/man2/ioctl_xfs_fsgetxattr.2
index 2c626a7e3742..d97fb1b508aa 100644
--- a/man/man2/ioctl_xfs_fsgetxattr.2
+++ b/man/man2/ioctl_xfs_fsgetxattr.2
@@ -200,6 +200,12 @@  below).
 If set on a directory, new files and subdirectories created in the directory
 will have both the flag and the CoW extent size value set.
 .TP
+.B XFS_XFLAG_FORCEALIGN
+Force Alignment bit - requires that all file data extents must be aligned
+to the extent size hint value.
+If set on a directory, new files and subdirectories created in the directory
+will have the flag set.
+.TP
 .B XFS_XFLAG_HASATTR
 The file has extended attributes associated with it.