All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: djwong@kernel.org, linux-xfs@vger.kernel.org,
	david@fromorbit.com, chandanbabu@kernel.org, cem@kernel.org
Cc: martin.petersen@oracle.com, John Garry <john.g.garry@oracle.com>
Subject: [PATCH 4/7] xfs_io: implement lsattr and chattr support for forcealign
Date: Fri, 29 Sep 2023 09:53:39 +0000	[thread overview]
Message-ID: <20230929095342.2976587-5-john.g.garry@oracle.com> (raw)
In-Reply-To: <20230929095342.2976587-1-john.g.garry@oracle.com>

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 --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.
 
-- 
2.34.1


  parent reply	other threads:[~2023-09-29  9:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29  9:53 [PATCH 0/7] xfsprogs: Enable extent forcealign feature John Garry
2023-09-29  9:53 ` [PATCH 1/7] xfs: create a new inode flag to require extsize alignment of file data space John Garry
2023-09-29  9:53 ` [PATCH 2/7] xfs: allow files to require data mappings to be aligned to extszhint John Garry
2023-09-29  9:53 ` [PATCH 3/7] xfs_db: expose force_align feature and flags John Garry
2023-09-29  9:53 ` John Garry [this message]
2023-09-29  9:53 ` [PATCH 5/7] xfs_repair: check the force-align flag John Garry
2023-09-29  9:53 ` [PATCH 6/7] mkfs: add an extsize= option that allows units John Garry
2023-09-29  9:53 ` [PATCH 7/7] mkfs: enable the new force-align feature John Garry

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=20230929095342.2976587-5-john.g.garry@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=cem@kernel.org \
    --cc=chandanbabu@kernel.org \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.