[PATCH 3/5] xfs_io: redefine what statx -m all does

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

As of kernel commit 581701b7efd60b ("uapi: deprecate STATX_ALL"),
STATX_ALL is deprecated and has been withdrawn from the kernel codebase.
The symbol still exists for userspace to avoid compilation breakage, but
we're all suppose to stop using it.

Therefore, redefine statx -m all to set all the bits except for the
reserved bit since it's pretty silly that "all" doesn't actually get you
all the fields.

Update the STATX_ALL definition in io/statx.h so people stop using it.

Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
---
 io/statx.h        |    8 +++++++-
 io/stat.c         |    7 ++++---
 man/man8/xfs_io.8 |    3 ++-
 3 files changed, 13 insertions(+), 5 deletions(-)


diff --git a/io/statx.h b/io/statx.h
index 273644f53cf1c4..f7ef1d2784a2a9 100644
--- a/io/statx.h
+++ b/io/statx.h
@@ -170,9 +170,15 @@ struct statx {
 #define STATX_BLOCKS		0x00000400U	/* Want/got stx_blocks */
 #define STATX_BASIC_STATS	0x000007ffU	/* The stuff in the normal stat struct */
 #define STATX_BTIME		0x00000800U	/* Want/got stx_btime */
-#define STATX_ALL		0x00000fffU	/* All currently supported flags */
 #define STATX__RESERVED		0x80000000U	/* Reserved for future struct statx expansion */
 
+/*
+ * This is deprecated, and shall remain the same value in the future.  To avoid
+ * confusion please use the equivalent (STATX_BASIC_STATS | STATX_BTIME)
+ * instead.
+ */
+#define STATX_ALL		0x00000fffU
+
 /*
  * Attributes to be found in stx_attributes
  *
diff --git a/io/stat.c b/io/stat.c
index b37b1a12b8b2fd..52e2d33010a99a 100644
--- a/io/stat.c
+++ b/io/stat.c
@@ -332,7 +332,8 @@ statx_help(void)
 " -v -- More verbose output\n"
 " -r -- Print raw statx structure fields\n"
 " -m mask -- Specify the field mask for the statx call\n"
-"            (can also be 'basic' or 'all'; default STATX_ALL)\n"
+"            (can also be 'basic' or 'all'; defaults to\n"
+"             STATX_BASIC_STATS | STATX_BTIME)\n"
 " -D -- Don't sync attributes with the server\n"
 " -F -- Force the attributes to be sync'd with the server\n"
 "\n"));
@@ -391,7 +392,7 @@ statx_f(
 	char		*p;
 	struct statx	stx;
 	int		atflag = 0;
-	unsigned int	mask = STATX_ALL;
+	unsigned int	mask = STATX_BASIC_STATS | STATX_BTIME;
 
 	while ((c = getopt(argc, argv, "m:rvFD")) != EOF) {
 		switch (c) {
@@ -399,7 +400,7 @@ statx_f(
 			if (strcmp(optarg, "basic") == 0)
 				mask = STATX_BASIC_STATS;
 			else if (strcmp(optarg, "all") == 0)
-				mask = STATX_ALL;
+				mask = ~STATX__RESERVED;
 			else {
 				mask = strtoul(optarg, &p, 0);
 				if (!p || p == optarg) {
diff --git a/man/man8/xfs_io.8 b/man/man8/xfs_io.8
index 726e25af272242..198215103812c6 100644
--- a/man/man8/xfs_io.8
+++ b/man/man8/xfs_io.8
@@ -994,7 +994,8 @@ .SH FILE I/O COMMANDS
 Set the field mask for the statx call to STATX_BASIC_STATS.
 .TP
 .B \-m all
-Set the the field mask for the statx call to STATX_ALL (default).
+Set all bits in the field mask for the statx call except for STATX__RESERVED.
+The default is to set STATX_BASIC_STATS and STATX_BTIME.
 .TP
 .B \-m <mask>
 Specify a numeric field mask for the statx call.





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux