Commit 8a59f5d2526593c6bc1a0754c3a16ccc9ed41ce3
Committed by
Linus Torvalds
1 parent
bdc8e5f85f
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff
fs/romfs/super.c
... | ... | @@ -408,12 +408,17 @@ |
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 |