Skip to content

Commit 8a59f5d

Browse files
Coly Litorvalds
authored andcommitted
fs/romfs: return f_fsid for statfs(2)
Make romfs return f_fsid info for statfs(2). Signed-off-by: Coly Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent bdc8e5f commit 8a59f5d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/romfs/super.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,17 @@ static void romfs_destroy_inode(struct inode *inode)
408408
*/
409409
static int romfs_statfs(struct dentry *dentry, struct kstatfs *buf)
410410
{
411+
struct super_block *sb = dentry->d_sb;
412+
u64 id = huge_encode_dev(sb->s_bdev->bd_dev);
413+
411414
buf->f_type = ROMFS_MAGIC;
412415
buf->f_namelen = ROMFS_MAXFN;
413416
buf->f_bsize = ROMBSIZE;
414417
buf->f_bfree = buf->f_bavail = buf->f_ffree;
415418
buf->f_blocks =
416419
(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);
417422
return 0;
418423
}
419424

0 commit comments

Comments
 (0)