[PATCH v2 03/29] xfsprogs: Stop using platform_test_xfs_path()

Pavel Reichl
2021-08-06T21:23:29Z

---
fsr/xfs_fsr.c | 2 +-
include/linux.h | 7 ++++++-
libfrog/paths.c | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 6cf8bfb7..25eb2e12 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -248,7 +248,7 @@ main(int argc, char **argv)
progname, argname);
exit(1);
} else if (S_ISDIR(sb.st_mode) || S_ISREG(sb.st_mode)) {
- if (!platform_test_xfs_path(argname)) {
+ if (!test_xfs_path(argname)) {
fprintf(stderr, _(
"%s: cannot defragment: %s: Not XFS\n"),
progname, argname);
diff --git a/include/linux.h b/include/linux.h
index f48ec823..1617174c 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -65,7 +65,7 @@ static __inline__ int platform_test_xfs_fd(int fd)
return test_xfs_fd(fd);
}

-static __inline__ int platform_test_xfs_path(const char *path)
+static __inline__ int test_xfs_path(const char *path)
{
struct statfs statfsbuf;
struct stat statbuf;
@@ -79,6 +79,11 @@ static __inline__ int platform_test_xfs_path(const char *path)
return (statfsbuf.f_type == 0x58465342); /* XFSB */
}

+static __inline__ int platform_test_xfs_path(const char *path)
+{
+ return test_xfs_path(path);
+}
+
static __inline__ int platform_fstatfs(int fd, struct statfs *buf)
{
return fstatfs(fd, buf);
diff --git a/libfrog/paths.c b/libfrog/paths.c
index d6793764..c86f258e 100644
--- a/libfrog/paths.c
+++ b/libfrog/paths.c
@@ -161,7 +161,7 @@ fs_table_insert(
goto out_nodev;
}

- if (!platform_test_xfs_path(dir))
+ if (!test_xfs_path(dir))
flags |= FS_FOREIGN;

/*
--
2.31.1