From: "Darrick J. Wong" <djwong@kernel.org>
To: aalbersh@kernel.org, djwong@kernel.org
Cc: john.g.garry@oracle.com, catherine.hoang@oracle.com,
john.g.garry@oracle.com, linux-xfs@vger.kernel.org
Subject: [PATCH 1/7] libfrog: move statx.h from io/ to libfrog/
Date: Mon, 14 Jul 2025 22:18:11 -0700 [thread overview]
Message-ID: <175255652472.1831001.17737248807808394626.stgit@frogsfrogsfrogs> (raw)
In-Reply-To: <175255652424.1831001.9800800142745344742.stgit@frogsfrogsfrogs>
From: Darrick J. Wong <djwong@kernel.org>
Move this header file so we can use the declaration and wrappers
in other parts of xfsprogs.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: John Garry <john.g.garry@oracle.com>
---
libfrog/statx.h | 17 +++++++++++++++++
io/stat.c | 20 ++------------------
libfrog/Makefile | 1 +
3 files changed, 20 insertions(+), 18 deletions(-)
rename io/statx.h => libfrog/statx.h (96%)
diff --git a/io/statx.h b/libfrog/statx.h
similarity index 96%
rename from io/statx.h
rename to libfrog/statx.h
index f7ef1d2784a2a9..b76dfae21e7092 100644
--- a/io/statx.h
+++ b/libfrog/statx.h
@@ -146,7 +146,24 @@ struct statx {
__u64 __spare3[9]; /* Spare space for future expansion */
/* 0x100 */
};
+
+static inline ssize_t
+statx(
+ int dfd,
+ const char *filename,
+ unsigned int flags,
+ unsigned int mask,
+ struct statx *buffer)
+{
+#ifdef __NR_statx
+ return syscall(__NR_statx, dfd, filename, flags, mask, buffer);
+#else
+ errno = ENOSYS;
+ return -1;
#endif
+}
+
+#endif /* OVERRIDE_SYSTEM_STATX */
#ifndef STATX_TYPE
/*
diff --git a/io/stat.c b/io/stat.c
index c3a4bb15229ee5..46475df343470c 100644
--- a/io/stat.c
+++ b/io/stat.c
@@ -14,7 +14,7 @@
#include "input.h"
#include "init.h"
#include "io.h"
-#include "statx.h"
+#include "libfrog/statx.h"
#include "libxfs.h"
#include "libfrog/logging.h"
#include "libfrog/fsgeom.h"
@@ -305,22 +305,6 @@ statfs_f(
return 0;
}
-static ssize_t
-_statx(
- int dfd,
- const char *filename,
- unsigned int flags,
- unsigned int mask,
- struct statx *buffer)
-{
-#ifdef __NR_statx
- return syscall(__NR_statx, dfd, filename, flags, mask, buffer);
-#else
- errno = ENOSYS;
- return -1;
-#endif
-}
-
struct statx_masks {
const char *name;
unsigned int mask;
@@ -525,7 +509,7 @@ statx_f(
return command_usage(&statx_cmd);
memset(&stx, 0xbf, sizeof(stx));
- if (_statx(file->fd, "", atflag | AT_EMPTY_PATH, mask, &stx) < 0) {
+ if (statx(file->fd, "", atflag | AT_EMPTY_PATH, mask, &stx) < 0) {
perror("statx");
exitcode = 1;
return 0;
diff --git a/libfrog/Makefile b/libfrog/Makefile
index b64ca4597f4ea9..560bad417ee434 100644
--- a/libfrog/Makefile
+++ b/libfrog/Makefile
@@ -62,6 +62,7 @@ ptvar.h \
radix-tree.h \
randbytes.h \
scrub.h \
+statx.h \
workqueue.h
GETTEXT_PY = \
next prev parent reply other threads:[~2025-07-15 5:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 5:13 [PATCHBOMB v2] xfsprogs: ports and new code for 6.16 Darrick J. Wong
2025-07-15 5:15 ` [PATCHSET 1/3] xfsprogs: new libxfs code from kernel 6.16 Darrick J. Wong
2025-07-15 5:16 ` [PATCH 1/6] xfs: add helpers to compute transaction reservation for finishing intent items Darrick J. Wong
2025-07-15 5:16 ` [PATCH 2/6] xfs: allow block allocator to take an alignment hint Darrick J. Wong
2025-07-15 5:17 ` [PATCH 3/6] xfs: commit CoW-based atomic writes atomically Darrick J. Wong
2025-07-15 5:17 ` [PATCH 4/6] libxfs: add helpers to compute log item overhead Darrick J. Wong
2025-07-18 14:03 ` Andrey Albershteyn
2025-07-15 5:17 ` [PATCH 5/6] xfs: add xfs_calc_atomic_write_unit_max() Darrick J. Wong
2025-07-15 5:17 ` [PATCH 6/6] xfs: allow sysadmins to specify a maximum atomic write limit at mount time Darrick J. Wong
2025-07-15 5:16 ` [PATCHSET 2/3] xfsprogs: atomic writes Darrick J. Wong
2025-07-15 5:18 ` Darrick J. Wong [this message]
2025-07-15 5:18 ` [PATCH 2/7] xfs_db: create an untorn_max subcommand Darrick J. Wong
2025-07-15 5:18 ` [PATCH 3/7] xfs_io: dump new atomic_write_unit_max_opt statx field Darrick J. Wong
2025-07-15 5:18 ` [PATCH 4/7] mkfs: don't complain about overly large auto-detected log stripe units Darrick J. Wong
2025-07-15 5:19 ` [PATCH 5/7] mkfs: autodetect log stripe unit for external log devices Darrick J. Wong
2025-07-15 5:19 ` [PATCH 6/7] mkfs: try to align AG size based on atomic write capabilities Darrick J. Wong
2025-07-15 5:19 ` [PATCH 7/7] mkfs: allow users to configure the desired maximum atomic write size Darrick J. Wong
2025-07-15 5:16 ` [PATCHSET 3/3] xfs_scrub: drop EXPERIMENTAL warning Darrick J. Wong
2025-07-15 5:20 ` [PATCH 1/1] xfs_scrub: remove EXPERIMENTAL warnings Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2025-07-01 18:05 [PATCHSET 2/3] xfsprogs: atomic writes Darrick J. Wong
2025-07-01 18:07 ` [PATCH 1/7] libfrog: move statx.h from io/ to libfrog/ Darrick J. Wong
2025-07-02 9:13 ` 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=175255652472.1831001.17737248807808394626.stgit@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=aalbersh@kernel.org \
--cc=catherine.hoang@oracle.com \
--cc=john.g.garry@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/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