linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] freevxfs: derive f_fsid from bdev->bd_dev
@ 2023-10-24 12:14 Amir Goldstein
  2023-10-25 14:28 ` Christoph Hellwig
  2023-10-25 20:52 ` Christian Brauner
  0 siblings, 2 replies; 3+ messages in thread
From: Amir Goldstein @ 2023-10-24 12:14 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Jan Kara, Christian Brauner, linux-fsdevel

The majority of blockdev filesystems, which do not have a UUID in their
on-disk format, derive f_fsid of statfs(2) from bdev->bd_dev.

Use the same practice for freevxfs.

This will allow reporting fanotify events with fanotify_event_info_fid.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---

Christoph,

This is only compiled tested, but the change is quite trivial.
Could you pick up this patch? or ACK it so that Christian can take it?

Thanks,
Amir.

 fs/freevxfs/vxfs_super.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c
index 310d73e254df..f13f47fd4279 100644
--- a/fs/freevxfs/vxfs_super.c
+++ b/fs/freevxfs/vxfs_super.c
@@ -76,6 +76,7 @@ vxfs_statfs(struct dentry *dentry, struct kstatfs *bufp)
 {
 	struct vxfs_sb_info		*infp = VXFS_SBI(dentry->d_sb);
 	struct vxfs_sb *raw_sb = infp->vsi_raw;
+	u64 id = huge_encode_dev(dentry->d_sb->s_bdev->bd_dev);
 
 	bufp->f_type = VXFS_SUPER_MAGIC;
 	bufp->f_bsize = dentry->d_sb->s_blocksize;
@@ -84,6 +85,7 @@ vxfs_statfs(struct dentry *dentry, struct kstatfs *bufp)
 	bufp->f_bavail = 0;
 	bufp->f_files = 0;
 	bufp->f_ffree = fs32_to_cpu(infp, raw_sb->vs_ifree);
+	bufp->f_fsid = u64_to_fsid(id);
 	bufp->f_namelen = VXFS_NAMELEN;
 
 	return 0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] freevxfs: derive f_fsid from bdev->bd_dev
  2023-10-24 12:14 [PATCH] freevxfs: derive f_fsid from bdev->bd_dev Amir Goldstein
@ 2023-10-25 14:28 ` Christoph Hellwig
  2023-10-25 20:52 ` Christian Brauner
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2023-10-25 14:28 UTC (permalink / raw)
  To: Amir Goldstein
  Cc: Christoph Hellwig, Jan Kara, Christian Brauner, linux-fsdevel

Looks good to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>

Christian, can you pick it up in the vfs tree?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] freevxfs: derive f_fsid from bdev->bd_dev
  2023-10-24 12:14 [PATCH] freevxfs: derive f_fsid from bdev->bd_dev Amir Goldstein
  2023-10-25 14:28 ` Christoph Hellwig
@ 2023-10-25 20:52 ` Christian Brauner
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2023-10-25 20:52 UTC (permalink / raw)
  To: Christoph Hellwig, Amir Goldstein
  Cc: Christian Brauner, Jan Kara, linux-fsdevel

On Tue, 24 Oct 2023 15:14:57 +0300, Amir Goldstein wrote:
> The majority of blockdev filesystems, which do not have a UUID in their
> on-disk format, derive f_fsid of statfs(2) from bdev->bd_dev.
> 
> Use the same practice for freevxfs.
> 
> This will allow reporting fanotify events with fanotify_event_info_fid.
> 
> [...]

Applied to the vfs.f_fsid branch of the vfs/vfs.git tree.
Patches in the vfs.f_fsid branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.f_fsid

[1/1] freevxfs: derive f_fsid from bdev->bd_dev
      https://git.kernel.org/vfs/vfs/c/462e67783c2e

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-25 20:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-24 12:14 [PATCH] freevxfs: derive f_fsid from bdev->bd_dev Amir Goldstein
2023-10-25 14:28 ` Christoph Hellwig
2023-10-25 20:52 ` Christian Brauner

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).