Skip to content

Commit

Permalink
freevxfs: derive f_fsid from bdev->bd_dev
Browse files Browse the repository at this point in the history
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>
Link: https://lore.kernel.org/r/20231024121457.3014063-1-amir73il@gmail.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
  • Loading branch information
Amir Goldstein authored and Christian Brauner committed Oct 28, 2023

Unverified

No user is associated with the committer email.
1 parent ae62bcb commit ceb3388
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/freevxfs/vxfs_super.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit ceb3388

Please sign in to comment.