linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Reichl <preichl@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH v2 13/29] xfsprogs: Stop using platform_check_ismounted()
Date: Fri,  6 Aug 2021 23:23:02 +0200	[thread overview]
Message-ID: <20210806212318.440144-14-preichl@redhat.com> (raw)
In-Reply-To: <20210806212318.440144-1-preichl@redhat.com>

---
 copy/xfs_copy.c           | 6 +++---
 libfrog/linux.c           | 8 +++++++-
 libfrog/platform.h        | 1 +
 libxfs/init.c             | 4 ++--
 mdrestore/xfs_mdrestore.c | 4 ++--
 5 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 5f8b5c57..f864bc31 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -17,7 +17,7 @@
 #define	rounddown(x, y)	(((x)/(y))*(y))
 #define uuid_equal(s,d) (uuid_compare((*s),(*d)) == 0)
 
-extern int	platform_check_ismounted(char *, char *, struct stat *, int);
+extern int	check_ismounted(char *, char *, struct stat *, int);
 
 static char 		*logfile_name;
 static FILE		*logerr;
@@ -698,7 +698,7 @@ main(int argc, char **argv)
 		 * check to make sure a filesystem isn't mounted
 		 * on the device
 		 */
-		if (platform_check_ismounted(source_name, NULL, &statbuf, 0))  {
+		if (check_ismounted(source_name, NULL, &statbuf, 0))  {
 			do_log(
 	_("%s:  Warning -- a filesystem is mounted on the source device.\n"),
 				progname);
@@ -842,7 +842,7 @@ main(int argc, char **argv)
 			 * check to make sure a filesystem isn't mounted
 			 * on the device
 			 */
-			if (platform_check_ismounted(target[i].name,
+			if (check_ismounted(target[i].name,
 							NULL, &statbuf, 0))  {
 				do_log(_("%s:  a filesystem is mounted "
 					"on target device \"%s\".\n"
diff --git a/libfrog/linux.c b/libfrog/linux.c
index f7fac2c8..6a933b85 100644
--- a/libfrog/linux.c
+++ b/libfrog/linux.c
@@ -114,7 +114,7 @@ platform_check_mount(char *name, char *block, struct stat *s, int flags)
 }
 
 int
-platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
+check_ismounted(char *name, char *block, struct stat *s, int verbose)
 {
 	int flags;
 
@@ -122,6 +122,12 @@ platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
 	return check_mount(name, block, s, flags);
 }
 
+int
+platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
+{
+	return check_ismounted(name, block, s, verbose);
+}
+
 int
 platform_check_iswritable(char *name, char *block, struct stat *s)
 {
diff --git a/libfrog/platform.h b/libfrog/platform.h
index 0aef318a..8a38aa45 100644
--- a/libfrog/platform.h
+++ b/libfrog/platform.h
@@ -9,6 +9,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 platform_set_blocksize(int fd, char *path, dev_t device, int bsz,
 		int fatal);
diff --git a/libxfs/init.c b/libxfs/init.c
index 1ec83791..0d833ab6 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -59,7 +59,7 @@ check_isactive(char *name, char *block, int fatal)
 		return 0;
 	if ((st.st_mode & S_IFMT) != S_IFBLK)
 		return 0;
-	if (platform_check_ismounted(name, block, &st, 0) == 0)
+	if (check_ismounted(name, block, &st, 0) == 0)
 		return 0;
 	if (platform_check_iswritable(name, block, &st))
 		return fatal ? 1 : 0;
@@ -212,7 +212,7 @@ check_open(char *path, int flags, char **rawfile, char **blockfile)
 			progname, path);
 		return 0;
 	}
-	if (!readonly && !inactive && platform_check_ismounted(path, *blockfile, NULL, 1))
+	if (!readonly && !inactive && check_ismounted(path, *blockfile, NULL, 1))
 		return 0;
 
 	if (inactive && check_isactive(path, *blockfile, ((readonly|dangerously)?1:0)))
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
index 1cd399db..4a894f3b 100644
--- a/mdrestore/xfs_mdrestore.c
+++ b/mdrestore/xfs_mdrestore.c
@@ -182,7 +182,7 @@ usage(void)
 	exit(1);
 }
 
-extern int	platform_check_ismounted(char *, char *, struct stat *, int);
+extern int	check_ismounted(char *, char *, struct stat *, int);
 
 int
 main(
@@ -275,7 +275,7 @@ main(
 		/*
 		 * check to make sure a filesystem isn't mounted on the device
 		 */
-		if (platform_check_ismounted(argv[optind], NULL, &statbuf, 0))
+		if (check_ismounted(argv[optind], NULL, &statbuf, 0))
 			fatal("a filesystem is mounted on target device \"%s\","
 				" cannot restore to a mounted filesystem.\n",
 				argv[optind]);
-- 
2.31.1


  parent reply	other threads:[~2021-08-06 21:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 21:22 [PATCH v2 00/29] xfsprogs: Drop the 'platform_' prefix Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 01/29] xfsprogs: Stop using platform_uuid_compare() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 02/29] xfsprogs: Stop using platform_test_xfs_fd() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 03/29] xfsprogs: Stop using platform_test_xfs_path() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 04/29] xfsprogs: Stop using platform_fstatfs() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 05/29] xfsprogs: Stop using platform_getoptreset() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 06/29] xfsprogs: Stop using platform_uuid_copy() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 07/29] xfsprogs: Stop using platform_uuid_generate() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 08/29] xfsprogs: Stop using platform_uuid_unparse() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 09/29] xfsprogs: Stop using platform_uuid_clear() Pavel Reichl
2021-08-06 21:22 ` [PATCH v2 10/29] xfsprogs: Stop using platform_uuid_parse() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 11/29] xfsprogs: Stop using platform_uuid_is_null() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 12/29] xfsprogs: Stop using platform_check_mount() Pavel Reichl
2021-08-06 21:23 ` Pavel Reichl [this message]
2021-08-06 21:23 ` [PATCH v2 14/29] xfsprogs: Stop using platform_flush_device() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 15/29] xfsprogs: Stop using platform_mntent_open() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 16/29] xfsprogs: Stop using platform_mntent_next() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 17/29] xfsprogs: Stop using platform_mntent_close() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 18/29] xfsprogs: Stop using platform_findsizes() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 19/29] xfsprogs: Stop using platform_discard_blocks Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 20/29] xfsprogs: Stop using platform_zero_range() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 21/29] xfsprogs: Stop using platform_crash() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 22/29] xfsprogs: Stop using platform_nproc() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 23/29] xfsprogs: Stop using platform_check_iswritable() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 24/29] xfsprogs: Stop using platform_set_blocksize() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 25/29] xfsprogs: Stop using platform_findrawpath() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 26/29] xfsprogs: Stop using platform_findblockpath() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 27/29] xfsprogs: Stop using platform_direct_blockdev() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 28/29] xfsprogs: Stop using platform_align_blockdev() Pavel Reichl
2021-08-06 21:23 ` [PATCH v2 29/29] xfsprogs: Stop using platform_physmem() Pavel Reichl
2021-08-06 23:05 ` [PATCH v2 00/29] xfsprogs: Drop the 'platform_' prefix Dave Chinner
2021-08-07 15:13   ` Pavel Reichl
2021-08-07 21:46     ` Dave Chinner

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=20210806212318.440144-14-preichl@redhat.com \
    --to=preichl@redhat.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;
as well as URLs for NNTP newsgroup(s).