] nilfs2: use atomic64_t type for inodes_count and blocks_count fields in nilfs_root struct
The cp_inodes_count and cp_blocks_count are represented as __le64 type in on-disk structure (struct nilfs_checkpoint). But analogous fields in in-core structure (struct nilfs_root) are represented by atomic_t type. This patch replaces atomic_t on atomic64_t type in representation of inodes_count and blocks_count fields in struct nilfs_root. Signed-off-by: Vyacheslav Dubeyko <slava@dubeyko.com> Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Acked-by: Joern Engel <joern@logfs.org> Cc: Clemens Eisserer <linuxhippy@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
c7ef972c44
commit
e5f7f84843
@@ -54,7 +54,7 @@ void nilfs_inode_add_blocks(struct inode *inode, int n)
|
||||
|
||||
inode_add_bytes(inode, (1 << inode->i_blkbits) * n);
|
||||
if (root)
|
||||
atomic_add(n, &root->blocks_count);
|
||||
atomic64_add(n, &root->blocks_count);
|
||||
}
|
||||
|
||||
void nilfs_inode_sub_blocks(struct inode *inode, int n)
|
||||
@@ -63,7 +63,7 @@ void nilfs_inode_sub_blocks(struct inode *inode, int n)
|
||||
|
||||
inode_sub_bytes(inode, (1 << inode->i_blkbits) * n);
|
||||
if (root)
|
||||
atomic_sub(n, &root->blocks_count);
|
||||
atomic64_sub(n, &root->blocks_count);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -369,7 +369,7 @@ struct inode *nilfs_new_inode(struct inode *dir, umode_t mode)
|
||||
goto failed_ifile_create_inode;
|
||||
/* reference count of i_bh inherits from nilfs_mdt_read_block() */
|
||||
|
||||
atomic_inc(&root->inodes_count);
|
||||
atomic64_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;
|
||||
@@ -801,7 +801,7 @@ void nilfs_evict_inode(struct inode *inode)
|
||||
|
||||
ret = nilfs_ifile_delete_inode(ii->i_root->ifile, inode->i_ino);
|
||||
if (!ret)
|
||||
atomic_dec(&ii->i_root->inodes_count);
|
||||
atomic64_dec(&ii->i_root->inodes_count);
|
||||
|
||||
nilfs_clear_inode(inode);
|
||||
|
||||
|
Reference in New Issue
Block a user