summaryrefslogtreecommitdiffstats
path: root/fs/jfs
diff options
context:
space:
mode:
authorColy Li <coly.li@suse.de>2009-01-21 00:05:39 +0800
committerDave Kleikamp <shaggy@linux.vnet.ibm.com>2009-01-27 10:56:14 -0600
commitb5c816a4f177604ae708892bba074b1d534fcbee (patch)
tree4b5aef6e9dfd4bc80db7b363b7aaa53580ea1e9a /fs/jfs
parentfec1878fe952b994125a3be7c94b1322db586f3b (diff)
downloadlinux-b5c816a4f177604ae708892bba074b1d534fcbee.tar.gz
linux-b5c816a4f177604ae708892bba074b1d534fcbee.tar.bz2
linux-b5c816a4f177604ae708892bba074b1d534fcbee.zip
jfs: return f_fsid for statfs(2)
This patch makes jfs return f_fsid info for statfs(2). By Andreas' suggestion, this patch populates a persistent f_fsid between boots/mounts with help of on-disk uuid record. Signed-off-by: Coly Li <coly.li@suse.de> Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Diffstat (limited to 'fs/jfs')
-rw-r--r--fs/jfs/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 0dae345e481b..59e07c10319d 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -29,6 +29,7 @@
#include <linux/posix_acl.h>
#include <linux/buffer_head.h>
#include <linux/exportfs.h>
+#include <linux/crc32.h>
#include <asm/uaccess.h>
#include <linux/seq_file.h>
@@ -168,6 +169,9 @@ static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf)
buf->f_files = maxinodes;
buf->f_ffree = maxinodes - (atomic_read(&imap->im_numinos) -
atomic_read(&imap->im_numfree));
+ buf->f_fsid.val[0] = (u32)crc32_le(0, sbi->uuid, sizeof(sbi->uuid)/2);
+ buf->f_fsid.val[1] = (u32)crc32_le(0, sbi->uuid + sizeof(sbi->uuid)/2,
+ sizeof(sbi->uuid)/2);
buf->f_namelen = JFS_NAME_MAX;
return 0;