diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-06-07 16:36:53 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2016-10-07 12:36:35 -0800 |
commit | b41b4ad27582a1694a5e3cc60547b284b28a6758 (patch) | |
tree | ae886fdb472a8412ce6f4f847228afdc8b70105b | |
parent | 805f0f8f1cedba5bf629936fd235676fee01b904 (diff) |
bcachefs: fill in f_fsid in statfs
-rw-r--r-- | drivers/md/bcache/fs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/bcache/fs.c b/drivers/md/bcache/fs.c index f707417b6756..e491ed3bc385 100644 --- a/drivers/md/bcache/fs.c +++ b/drivers/md/bcache/fs.c @@ -1110,6 +1110,7 @@ static int bch_statfs(struct dentry *dentry, struct kstatfs *buf) { struct super_block *sb = dentry->d_sb; struct cache_set *c = sb->s_fs_info; + u64 fsid; buf->f_type = BCACHE_STATFS_MAGIC; buf->f_bsize = sb->s_blocksize; @@ -1118,6 +1119,11 @@ static int bch_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bavail = buf->f_bfree; buf->f_files = atomic_long_read(&c->nr_inodes); buf->f_ffree = U64_MAX; + + fsid = le64_to_cpup((void *) c->disk_sb.user_uuid.b) ^ + le64_to_cpup((void *) c->disk_sb.user_uuid.b + sizeof(u64)); + buf->f_fsid.val[0] = fsid & 0xFFFFFFFFUL; + buf->f_fsid.val[1] = (fsid >> 32) & 0xFFFFFFFFUL; buf->f_namelen = NAME_MAX; return 0; |