mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ojaswin Mujoo <ojaswin@linux.ibm.com>
To: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org
Cc: Ritesh Harjani <ritesh.list@gmail.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Andrey Albershteyn <aalbersh@kernel.org>,
	"Darrick J . Wong" <djwong@kernel.org>,
	John Garry <john.g.garry@oracle.com>
Subject: [PATCH 1/3] include/linux.h: use linux/magic.h to get XFS_SUPER_MAGIC
Date: Sun, 15 Dec 2024 14:47:15 +0530	[thread overview]
Message-ID: <713c4e61358b95bbdf95daca094abc73a230e52f.1734253505.git.ojaswin@linux.ibm.com> (raw)
In-Reply-To: <cover.1734253505.git.ojaswin@linux.ibm.com>

This avoids open coding the magic number

Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
---
 include/linux.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux.h b/include/linux.h
index e9eb7bfb26a1..306a31e092a7 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -37,6 +37,7 @@
 #endif
 #include <unistd.h>
 #include <assert.h>
+#include <linux/magic.h> /* super block magic numbers */
 
 static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p)
 {
@@ -60,7 +61,7 @@ static __inline__ int platform_test_xfs_fd(int fd)
 		return 0;
 	if (!S_ISREG(statbuf.st_mode) && !S_ISDIR(statbuf.st_mode))
 		return 0;
-	return (statfsbuf.f_type == 0x58465342);	/* XFSB */
+	return (statfsbuf.f_type == XFS_SUPER_MAGIC);
 }
 
 static __inline__ int platform_test_xfs_path(const char *path)
-- 
2.43.5


  reply	other threads:[~2024-12-15  9:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15  9:17 [PATCH 0/3] xfs_io: enable extsize and stat -v support for ext4 Ojaswin Mujoo
2024-12-15  9:17 ` Ojaswin Mujoo [this message]
2024-12-16  8:28   ` [PATCH 1/3] include/linux.h: use linux/magic.h to get XFS_SUPER_MAGIC Christoph Hellwig
2024-12-17  5:39     ` Ojaswin Mujoo
2024-12-15  9:17 ` [PATCH 2/3] xfs_io: allow foreign FSes to show FS_IOC_FSGETXATTR details Ojaswin Mujoo
2024-12-15  9:17 ` [PATCH 3/3] xfs_io: add extsize command support Ojaswin Mujoo

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=713c4e61358b95bbdf95daca094abc73a230e52f.1734253505.git.ojaswin@linux.ibm.com \
    --to=ojaswin@linux.ibm.com \
    --cc=aalbersh@kernel.org \
    --cc=djwong@kernel.org \
    --cc=john.g.garry@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    /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

all inboxes | Powered by JetHome®