summaryrefslogtreecommitdiff
path: root/fs/nilfs2/super.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-08-14 09:48:32 +0400
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-23 04:24:35 +0400
commitb7c0634204993d7c6678c852e4bd118426599111 (patch)
tree4934238a49a56aaa072b4dea79b836439be760d8 /fs/nilfs2/super.c
parente912a5b66837ee89fb025e67b5efeaa11930c2ce (diff)
downloadlinux-b7c0634204993d7c6678c852e4bd118426599111.tar.xz
nilfs2: move inode count and block count into root object
This moves sbi->s_inodes_count and sbi->s_blocks_count into nilfs_root object. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r--fs/nilfs2/super.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 87c57810ae88..acfa74e45f0b 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -429,8 +429,9 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno, int curr_mnt,
err = nilfs_read_inode_common(root->ifile, &raw_cp->cp_ifile_inode);
if (unlikely(err))
goto failed_bh;
- atomic_set(&sbi->s_inodes_count, le64_to_cpu(raw_cp->cp_inodes_count));
- atomic_set(&sbi->s_blocks_count, le64_to_cpu(raw_cp->cp_blocks_count));
+
+ atomic_set(&root->inodes_count, le64_to_cpu(raw_cp->cp_inodes_count));
+ atomic_set(&root->blocks_count, le64_to_cpu(raw_cp->cp_blocks_count));
nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, cno, bh_cp);
@@ -449,8 +450,8 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno, int curr_mnt,
static int nilfs_statfs(struct dentry *dentry, struct kstatfs *buf)
{
struct super_block *sb = dentry->d_sb;
- struct nilfs_sb_info *sbi = NILFS_SB(sb);
- struct the_nilfs *nilfs = sbi->s_nilfs;
+ struct nilfs_root *root = NILFS_I(dentry->d_inode)->i_root;
+ struct the_nilfs *nilfs = root->nilfs;
u64 id = huge_encode_dev(sb->s_bdev->bd_dev);
unsigned long long blocks;
unsigned long overhead;
@@ -486,7 +487,7 @@ static int nilfs_statfs(struct dentry *dentry, struct kstatfs *buf)
buf->f_bfree = nfreeblocks;
buf->f_bavail = (buf->f_bfree >= nrsvblocks) ?
(buf->f_bfree - nrsvblocks) : 0;
- buf->f_files = atomic_read(&sbi->s_inodes_count);
+ buf->f_files = atomic_read(&root->inodes_count);
buf->f_ffree = 0; /* nilfs_count_free_inodes(sb); */
buf->f_namelen = NILFS_NAME_LEN;
buf->f_fsid.val[0] = (u32)id;