Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213746
b: refs/heads/master
c: b7c0634
h: refs/heads/master
v: v3
  • Loading branch information
Ryusuke Konishi committed Oct 23, 2010
1 parent 4251782 commit 70cb038
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e912a5b66837ee89fb025e67b5efeaa11930c2ce
refs/heads/master: b7c0634204993d7c6678c852e4bd118426599111
4 changes: 2 additions & 2 deletions trunk/fs/nilfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ struct inode *nilfs_new_inode(struct inode *dir, int mode)
goto failed_ifile_create_inode;
/* reference count of i_bh inherits from nilfs_mdt_read_block() */

atomic_inc(&sbi->s_inodes_count);
atomic_inc(&root->inodes_count);
inode_init_owner(inode, dir, mode);
inode->i_ino = ino;
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
Expand Down Expand Up @@ -715,7 +715,7 @@ void nilfs_evict_inode(struct inode *inode)
end_writeback(inode);

nilfs_ifile_delete_inode(ii->i_root->ifile, inode->i_ino);
atomic_dec(&NILFS_SB(sb)->s_inodes_count);
atomic_dec(&ii->i_root->inodes_count);

nilfs_clear_inode(inode);

Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/nilfs2/sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ struct nilfs_sc_info;
struct nilfs_sb_info {
/* Snapshot status */
__u64 s_snapshot_cno; /* Checkpoint number */
atomic_t s_inodes_count;
atomic_t s_blocks_count; /* Reserved (might be deleted) */

/* Mount options */
unsigned long s_mount_opt;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/nilfs2/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,9 +856,9 @@ static int nilfs_segctor_fill_in_checkpoint(struct nilfs_sc_info *sci)
raw_cp->cp_snapshot_list.ssl_next = 0;
raw_cp->cp_snapshot_list.ssl_prev = 0;
raw_cp->cp_inodes_count =
cpu_to_le64(atomic_read(&sbi->s_inodes_count));
cpu_to_le64(atomic_read(&sci->sc_root->inodes_count));
raw_cp->cp_blocks_count =
cpu_to_le64(atomic_read(&sbi->s_blocks_count));
cpu_to_le64(atomic_read(&sci->sc_root->blocks_count));
raw_cp->cp_nblk_inc =
cpu_to_le64(sci->sc_nblk_inc + sci->sc_nblk_this_inc);
raw_cp->cp_create = cpu_to_le64(sci->sc_seg_ctime);
Expand Down
11 changes: 6 additions & 5 deletions trunk/fs/nilfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 70cb038

Please sign in to comment.