Skip to content

Commit

Permalink
fs/minix: return f_fsid for statfs(2)
Browse files Browse the repository at this point in the history
Make minix file system 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]>
  • Loading branch information
Coly Li authored and torvalds committed Apr 3, 2009
1 parent 2430c4d commit 054475d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions fs/minix/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,20 @@ static int minix_fill_super(struct super_block *s, void *data, int silent)

static int minix_statfs(struct dentry *dentry, struct kstatfs *buf)
{
struct minix_sb_info *sbi = minix_sb(dentry->d_sb);
buf->f_type = dentry->d_sb->s_magic;
buf->f_bsize = dentry->d_sb->s_blocksize;
struct super_block *sb = dentry->d_sb;
struct minix_sb_info *sbi = minix_sb(sb);
u64 id = huge_encode_dev(sb->s_bdev->bd_dev);
buf->f_type = sb->s_magic;
buf->f_bsize = sb->s_blocksize;
buf->f_blocks = (sbi->s_nzones - sbi->s_firstdatazone) << sbi->s_log_zone_size;
buf->f_bfree = minix_count_free_blocks(sbi);
buf->f_bavail = buf->f_bfree;
buf->f_files = sbi->s_ninodes;
buf->f_ffree = minix_count_free_inodes(sbi);
buf->f_namelen = sbi->s_namelen;
buf->f_fsid.val[0] = (u32)id;
buf->f_fsid.val[1] = (u32)(id >> 32);

return 0;
}

Expand Down

0 comments on commit 054475d

Please sign in to comment.