[PATCH v2 23/29] xfsprogs: Stop using platform_check_iswritable()

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

---
libfrog/linux.c | 8 +++++++-
libfrog/platform.h | 1 +
libxfs/init.c | 2 +-
3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/libfrog/linux.c b/libfrog/linux.c
index ee163661..4e75247e 100644
--- a/libfrog/linux.c
+++ b/libfrog/linux.c
@@ -129,7 +129,7 @@ platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
}

int
-platform_check_iswritable(char *name, char *block, struct stat *s)
+check_iswritable(char *name, char *block, struct stat *s)
{
int flags;

@@ -138,6 +138,12 @@ platform_check_iswritable(char *name, char *block, struct stat *s)
return check_mount(name, block, s, flags);
}

+int
+platform_check_iswritable(char *name, char *block, struct stat *s)
+{
+ return check_iswritable(name, block, s);
+}
+
int
platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fatal)
{
diff --git a/libfrog/platform.h b/libfrog/platform.h
index 914da2c7..69f432f7 100644
--- a/libfrog/platform.h
+++ b/libfrog/platform.h
@@ -11,6 +11,7 @@ int platform_check_ismounted(char *path, char *block, struct stat *sptr,
int verbose);
int check_ismounted(char *path, char *block, struct stat *sptr, int verbose);
int platform_check_iswritable(char *path, char *block, struct stat *sptr);
+int check_iswritable(char *path, char *block, struct stat *sptr);
int platform_set_blocksize(int fd, char *path, dev_t device, int bsz,
int fatal);
int platform_flush_device(int fd, dev_t device);
diff --git a/libxfs/init.c b/libxfs/init.c
index 7bc3b59d..9fb4f9d8 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -61,7 +61,7 @@ check_isactive(char *name, char *block, int fatal)
return 0;
if (check_ismounted(name, block, &st, 0) == 0)
return 0;
- if (platform_check_iswritable(name, block, &st))
+ if (check_iswritable(name, block, &st))
return fatal ? 1 : 0;
return 0;
}
--
2.31.1