diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-08-14 01:48:32 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-10-22 20:24:35 -0400 |
commit | b7c0634204993d7c6678c852e4bd118426599111 (patch) | |
tree | 4934238a49a56aaa072b4dea79b836439be760d8 /fs/nilfs2/super.c | |
parent | e912a5b66837ee89fb025e67b5efeaa11930c2ce (diff) |
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.c | 11 |
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, | |||
429 | err = nilfs_read_inode_common(root->ifile, &raw_cp->cp_ifile_inode); | 429 | err = nilfs_read_inode_common(root->ifile, &raw_cp->cp_ifile_inode); |
430 | if (unlikely(err)) | 430 | if (unlikely(err)) |
431 | goto failed_bh; | 431 | goto failed_bh; |
432 | atomic_set(&sbi->s_inodes_count, le64_to_cpu(raw_cp->cp_inodes_count)); | 432 | |
433 | atomic_set(&sbi->s_blocks_count, le64_to_cpu(raw_cp->cp_blocks_count)); | 433 | atomic_set(&root->inodes_count, le64_to_cpu(raw_cp->cp_inodes_count)); |
434 | atomic_set(&root->blocks_count, le64_to_cpu(raw_cp->cp_blocks_count)); | ||
434 | 435 | ||
435 | nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, cno, bh_cp); | 436 | nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, cno, bh_cp); |
436 | 437 | ||
@@ -449,8 +450,8 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno, int curr_mnt, | |||
449 | static int nilfs_statfs(struct dentry *dentry, struct kstatfs *buf) | 450 | static int nilfs_statfs(struct dentry *dentry, struct kstatfs *buf) |
450 | { | 451 | { |
451 | struct super_block *sb = dentry->d_sb; | 452 | struct super_block *sb = dentry->d_sb; |
452 | struct nilfs_sb_info *sbi = NILFS_SB(sb); | 453 | struct nilfs_root *root = NILFS_I(dentry->d_inode)->i_root; |
453 | struct the_nilfs *nilfs = sbi->s_nilfs; | 454 | struct the_nilfs *nilfs = root->nilfs; |
454 | u64 id = huge_encode_dev(sb->s_bdev->bd_dev); | 455 | u64 id = huge_encode_dev(sb->s_bdev->bd_dev); |
455 | unsigned long long blocks; | 456 | unsigned long long blocks; |
456 | unsigned long overhead; | 457 | unsigned long overhead; |
@@ -486,7 +487,7 @@ static int nilfs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
486 | buf->f_bfree = nfreeblocks; | 487 | buf->f_bfree = nfreeblocks; |
487 | buf->f_bavail = (buf->f_bfree >= nrsvblocks) ? | 488 | buf->f_bavail = (buf->f_bfree >= nrsvblocks) ? |
488 | (buf->f_bfree - nrsvblocks) : 0; | 489 | (buf->f_bfree - nrsvblocks) : 0; |
489 | buf->f_files = atomic_read(&sbi->s_inodes_count); | 490 | buf->f_files = atomic_read(&root->inodes_count); |
490 | buf->f_ffree = 0; /* nilfs_count_free_inodes(sb); */ | 491 | buf->f_ffree = 0; /* nilfs_count_free_inodes(sb); */ |
491 | buf->f_namelen = NILFS_NAME_LEN; | 492 | buf->f_namelen = NILFS_NAME_LEN; |
492 | buf->f_fsid.val[0] = (u32)id; | 493 | buf->f_fsid.val[0] = (u32)id; |