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 02/29] xfsprogs: Stop using platform_test_xfs_fd()
Date: Fri,  6 Aug 2021 23:22:51 +0200	[thread overview]
Message-ID: <20210806212318.440144-3-preichl@redhat.com> (raw)
In-Reply-To: <20210806212318.440144-1-preichl@redhat.com>

---
 copy/xfs_copy.c     | 4 ++--
 growfs/xfs_growfs.c | 2 +-
 include/linux.h     | 7 ++++++-
 io/init.c           | 2 +-
 io/open.c           | 4 ++--
 spaceman/init.c     | 2 +-
 6 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 841ab7e4..a7cbae02 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -670,7 +670,7 @@ main(int argc, char **argv)
 	if (S_ISREG(statbuf.st_mode))
 		source_is_file = 1;
 
-	if (source_is_file && platform_test_xfs_fd(source_fd))  {
+	if (source_is_file && test_xfs_fd(source_fd))  {
 		if (fcntl(source_fd, F_SETFL, open_flags | O_DIRECT) < 0)  {
 			do_log(_("%s: Cannot set direct I/O flag on \"%s\".\n"),
 				progname, source_name);
@@ -869,7 +869,7 @@ main(int argc, char **argv)
 					progname);
 				die_perror();
 			}
-			if (platform_test_xfs_fd(target[i].fd))  {
+			if (test_xfs_fd(target[i].fd))  {
 				if (xfsctl(target[i].name, target[i].fd,
 						XFS_IOC_DIOINFO, &d) < 0)  {
 					do_log(
diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c
index d45ba703..dc01dfe8 100644
--- a/growfs/xfs_growfs.c
+++ b/growfs/xfs_growfs.c
@@ -160,7 +160,7 @@ main(int argc, char **argv)
 		return 1;
 	}
 
-	if (!platform_test_xfs_fd(ffd)) {
+	if (!test_xfs_fd(ffd)) {
 		fprintf(stderr, _("%s: specified file "
 			"[\"%s\"] is not on an XFS filesystem\n"),
 			progname, fname);
diff --git a/include/linux.h b/include/linux.h
index a22f7812..f48ec823 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -46,7 +46,7 @@ static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
  * so return 0 for those
  */
 
-static __inline__ int platform_test_xfs_fd(int fd)
+static __inline__ int test_xfs_fd(int fd)
 {
 	struct statfs statfsbuf;
 	struct stat statbuf;
@@ -60,6 +60,11 @@ static __inline__ int platform_test_xfs_fd(int fd)
 	return (statfsbuf.f_type == 0x58465342);	/* XFSB */
 }
 
+static __inline__ int platform_test_xfs_fd(int fd)
+{
+	return test_xfs_fd(fd);
+}
+
 static __inline__ int platform_test_xfs_path(const char *path)
 {
 	struct statfs statfsbuf;
diff --git a/io/init.c b/io/init.c
index 033ed67d..bd31b474 100644
--- a/io/init.c
+++ b/io/init.c
@@ -219,7 +219,7 @@ init(
 		c = openfile(argv[optind], &geometry, flags, mode, &fsp);
 		if (c < 0)
 			exit(1);
-		if (!platform_test_xfs_fd(c))
+		if (!test_xfs_fd(c))
 			flags |= IO_FOREIGN;
 		if (addfile(argv[optind], c, &geometry, flags, &fsp) < 0)
 			exit(1);
diff --git a/io/open.c b/io/open.c
index d8072664..498e6163 100644
--- a/io/open.c
+++ b/io/open.c
@@ -115,7 +115,7 @@ openfile(
 		}
 	}
 
-	if (!geom || !platform_test_xfs_fd(fd))
+	if (!geom || !test_xfs_fd(fd))
 		return fd;
 
 	if (flags & IO_PATH) {
@@ -326,7 +326,7 @@ open_f(
 		return 0;
 	}
 
-	if (!platform_test_xfs_fd(fd))
+	if (!test_xfs_fd(fd))
 		flags |= IO_FOREIGN;
 
 	if (addfile(argv[optind], fd, &geometry, flags, &fsp) != 0) {
diff --git a/spaceman/init.c b/spaceman/init.c
index cf1ff3cb..8ad70929 100644
--- a/spaceman/init.c
+++ b/spaceman/init.c
@@ -93,7 +93,7 @@ init(
 	c = openfile(argv[optind], &xfd, &fsp);
 	if (c < 0)
 		exit(1);
-	if (!platform_test_xfs_fd(xfd.fd))
+	if (!test_xfs_fd(xfd.fd))
 		printf(_("Not an XFS filesystem!\n"));
 	c = addfile(argv[optind], &xfd, &fsp);
 	if (c < 0)
-- 
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 ` Pavel Reichl [this message]
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 ` [PATCH v2 13/29] xfsprogs: Stop using platform_check_ismounted() Pavel Reichl
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-3-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).