All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org,
	Ritesh Harjani <ritesh.list@gmail.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Andrey Albershteyn <aalbersh@kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2 1/3] include/linux.h: use linux/magic.h to get XFS_SUPER_MAGIC
Date: Thu, 19 Dec 2024 07:55:32 -0800	[thread overview]
Message-ID: <20241219155532.GF6174@frogsfrogsfrogs> (raw)
In-Reply-To: <66f4220d2c2da6ce143114f9635ed8cd4e54af1d.1734611784.git.ojaswin@linux.ibm.com>

On Thu, Dec 19, 2024 at 06:09:13PM +0530, Ojaswin Mujoo wrote:
> This avoids open coding the magic number
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>

Looks reasonable,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  include/linux.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux.h b/include/linux.h
> index e9eb7bfb26a1..b3516d54c51b 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-19 15:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19 12:39 [PATCH v2 0/3] xfs_io: enable extsize and stat -v support for ext4 Ojaswin Mujoo
2024-12-19 12:39 ` [PATCH v2 1/3] include/linux.h: use linux/magic.h to get XFS_SUPER_MAGIC Ojaswin Mujoo
2024-12-19 15:55   ` Darrick J. Wong [this message]
2024-12-19 12:39 ` [PATCH v2 2/3] xfs_io: allow foreign FSes to show FS_IOC_FSGETXATTR details Ojaswin Mujoo
2024-12-19 15:56   ` Darrick J. Wong
2024-12-19 12:39 ` [PATCH v2 3/3] xfs_io: add extsize command support Ojaswin Mujoo
2024-12-19 15:57   ` Darrick J. Wong

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=20241219155532.GF6174@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=hch@lst.de \
    --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=ojaswin@linux.ibm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.