Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs/romfs: return f_fsid for statfs(2)

Make romfs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Coly Li and committed by
Linus Torvalds
8a59f5d2 bdc8e5f8

+5
+5
fs/romfs/super.c
··· 408 408 */ 409 409 static int romfs_statfs(struct dentry *dentry, struct kstatfs *buf) 410 410 { 411 + struct super_block *sb = dentry->d_sb; 412 + u64 id = huge_encode_dev(sb->s_bdev->bd_dev); 413 + 411 414 buf->f_type = ROMFS_MAGIC; 412 415 buf->f_namelen = ROMFS_MAXFN; 413 416 buf->f_bsize = ROMBSIZE; 414 417 buf->f_bfree = buf->f_bavail = buf->f_ffree; 415 418 buf->f_blocks = 416 419 (romfs_maxsize(dentry->d_sb) + ROMBSIZE - 1) >> ROMBSBITS; 420 + buf->f_fsid.val[0] = (u32)id; 421 + buf->f_fsid.val[1] = (u32)(id >> 32); 417 422 return 0; 418 423 } 419 424