public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 12/20] fs/minix: return f_fsid for statfs(2)
@ 2009-01-19 17:34 Coly Li
  0 siblings, 0 replies; only message in thread
From: Coly Li @ 2009-01-19 17:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

This patch makes minix file system return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 fs/minix/inode.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index d1d1eb8..f6f23b6 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -321,15 +321,20 @@ out:

 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;
 }

-- 
Coly Li
SuSE Labs




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-19 17:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-19 17:34 [PATCH 12/20] fs/minix: return f_fsid for statfs(2) Coly Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox