f2fs: cleanup duplicate stats for atomic files
Remove duplicate sbi->aw_cnt stats counter that tracks the number of atomic files currently opened (it also shows incorrect value sometimes). Use more relit lable sbi->atomic_files to show in the stats. Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
d508c94e45
commit
0e6d01643c
|
@ -56,7 +56,7 @@ static void update_general_status(struct f2fs_sb_info *sbi)
|
|||
si->nquota_files = sbi->nquota_files;
|
||||
si->ndirty_all = sbi->ndirty_inode[DIRTY_META];
|
||||
si->inmem_pages = get_pages(sbi, F2FS_INMEM_PAGES);
|
||||
si->aw_cnt = atomic_read(&sbi->aw_cnt);
|
||||
si->aw_cnt = sbi->atomic_files;
|
||||
si->vw_cnt = atomic_read(&sbi->vw_cnt);
|
||||
si->max_aw_cnt = atomic_read(&sbi->max_aw_cnt);
|
||||
si->max_vw_cnt = atomic_read(&sbi->max_vw_cnt);
|
||||
|
@ -495,7 +495,6 @@ int f2fs_build_stats(struct f2fs_sb_info *sbi)
|
|||
for (i = META_CP; i < META_MAX; i++)
|
||||
atomic_set(&sbi->meta_count[i], 0);
|
||||
|
||||
atomic_set(&sbi->aw_cnt, 0);
|
||||
atomic_set(&sbi->vw_cnt, 0);
|
||||
atomic_set(&sbi->max_aw_cnt, 0);
|
||||
atomic_set(&sbi->max_vw_cnt, 0);
|
||||
|
|
|
@ -1327,7 +1327,6 @@ struct f2fs_sb_info {
|
|||
atomic_t inline_xattr; /* # of inline_xattr inodes */
|
||||
atomic_t inline_inode; /* # of inline_data inodes */
|
||||
atomic_t inline_dir; /* # of inline_dentry inodes */
|
||||
atomic_t aw_cnt; /* # of atomic writes */
|
||||
atomic_t vw_cnt; /* # of volatile writes */
|
||||
atomic_t max_aw_cnt; /* max # of atomic writes */
|
||||
atomic_t max_vw_cnt; /* max # of volatile writes */
|
||||
|
@ -3388,13 +3387,9 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
|
|||
((sbi)->block_count[(curseg)->alloc_type]++)
|
||||
#define stat_inc_inplace_blocks(sbi) \
|
||||
(atomic_inc(&(sbi)->inplace_count))
|
||||
#define stat_inc_atomic_write(inode) \
|
||||
(atomic_inc(&F2FS_I_SB(inode)->aw_cnt))
|
||||
#define stat_dec_atomic_write(inode) \
|
||||
(atomic_dec(&F2FS_I_SB(inode)->aw_cnt))
|
||||
#define stat_update_max_atomic_write(inode) \
|
||||
do { \
|
||||
int cur = atomic_read(&F2FS_I_SB(inode)->aw_cnt); \
|
||||
int cur = F2FS_I_SB(inode)->atomic_files; \
|
||||
int max = atomic_read(&F2FS_I_SB(inode)->max_aw_cnt); \
|
||||
if (cur > max) \
|
||||
atomic_set(&F2FS_I_SB(inode)->max_aw_cnt, cur); \
|
||||
|
|
|
@ -1936,7 +1936,6 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
|
|||
|
||||
f2fs_update_time(F2FS_I_SB(inode), REQ_TIME);
|
||||
F2FS_I(inode)->inmem_task = current;
|
||||
stat_inc_atomic_write(inode);
|
||||
stat_update_max_atomic_write(inode);
|
||||
out:
|
||||
inode_unlock(inode);
|
||||
|
|
|
@ -334,7 +334,6 @@ void f2fs_drop_inmem_pages(struct inode *inode)
|
|||
}
|
||||
|
||||
fi->i_gc_failures[GC_FAILURE_ATOMIC] = 0;
|
||||
stat_dec_atomic_write(inode);
|
||||
|
||||
spin_lock(&sbi->inode_lock[ATOMIC_FILE]);
|
||||
if (!list_empty(&fi->inmem_ilist))
|
||||
|
|
Loading…
Reference in New Issue