Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcdfff65 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: clean up several status-related operations



This patch cleans up improper definitions that update some status information.

Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 7bd59381
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -467,9 +467,7 @@ static int __add_dirty_inode(struct inode *inode, struct dir_inode_entry *new)
			return -EEXIST;
			return -EEXIST;
	}
	}
	list_add_tail(&new->list, head);
	list_add_tail(&new->list, head);
#ifdef CONFIG_F2FS_STAT_FS
	stat_inc_dirty_dir(sbi);
	sbi->n_dirty_dirs++;
#endif
	return 0;
	return 0;
}
}


@@ -531,9 +529,7 @@ void remove_dirty_dir_inode(struct inode *inode)
		if (entry->inode == inode) {
		if (entry->inode == inode) {
			list_del(&entry->list);
			list_del(&entry->list);
			kmem_cache_free(inode_entry_slab, entry);
			kmem_cache_free(inode_entry_slab, entry);
#ifdef CONFIG_F2FS_STAT_FS
			stat_dec_dirty_dir(sbi);
			sbi->n_dirty_dirs--;
#endif
			break;
			break;
		}
		}
	}
	}
+3 −9
Original line number Original line Diff line number Diff line
@@ -68,9 +68,6 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs,
					struct buffer_head *bh_result)
					struct buffer_head *bh_result)
{
{
	struct f2fs_inode_info *fi = F2FS_I(inode);
	struct f2fs_inode_info *fi = F2FS_I(inode);
#ifdef CONFIG_F2FS_STAT_FS
	struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
#endif
	pgoff_t start_fofs, end_fofs;
	pgoff_t start_fofs, end_fofs;
	block_t start_blkaddr;
	block_t start_blkaddr;


@@ -80,9 +77,8 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs,
		return 0;
		return 0;
	}
	}


#ifdef CONFIG_F2FS_STAT_FS
	stat_inc_total_hit(inode->i_sb);
	sbi->total_hit_ext++;

#endif
	start_fofs = fi->ext.fofs;
	start_fofs = fi->ext.fofs;
	end_fofs = fi->ext.fofs + fi->ext.len - 1;
	end_fofs = fi->ext.fofs + fi->ext.len - 1;
	start_blkaddr = fi->ext.blk_addr;
	start_blkaddr = fi->ext.blk_addr;
@@ -100,9 +96,7 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs,
		else
		else
			bh_result->b_size = UINT_MAX;
			bh_result->b_size = UINT_MAX;


#ifdef CONFIG_F2FS_STAT_FS
		stat_inc_read_hit(inode->i_sb);
		sbi->read_hit_ext++;
#endif
		read_unlock(&fi->ext.ext_lock);
		read_unlock(&fi->ext.ext_lock);
		return 1;
		return 1;
	}
	}
+17 −1
Original line number Original line Diff line number Diff line
@@ -1156,6 +1156,15 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
}
}


#define stat_inc_call_count(si)		((si)->call_count++)
#define stat_inc_call_count(si)		((si)->call_count++)
#define stat_inc_bggc_count(sbi)	((sbi)->bg_gc++)
#define stat_inc_dirty_dir(sbi)		((sbi)->n_dirty_dirs++)
#define stat_dec_dirty_dir(sbi)		((sbi)->n_dirty_dirs--)
#define stat_inc_total_hit(sb)		((F2FS_SB(sb))->total_hit_ext++)
#define stat_inc_read_hit(sb)		((F2FS_SB(sb))->read_hit_ext++)
#define stat_inc_seg_type(sbi, curseg)					\
		((sbi)->segment_count[(curseg)->alloc_type]++)
#define stat_inc_block_count(sbi, curseg)				\
		((sbi)->block_count[(curseg)->alloc_type]++)


#define stat_inc_seg_count(sbi, type)					\
#define stat_inc_seg_count(sbi, type)					\
	do {								\
	do {								\
@@ -1190,6 +1199,13 @@ void __init f2fs_create_root_stats(void);
void f2fs_destroy_root_stats(void);
void f2fs_destroy_root_stats(void);
#else
#else
#define stat_inc_call_count(si)
#define stat_inc_call_count(si)
#define stat_inc_bggc_count(si)
#define stat_inc_dirty_dir(sbi)
#define stat_dec_dirty_dir(sbi)
#define stat_inc_total_hit(sb)
#define stat_inc_read_hit(sb)
#define stat_inc_seg_type(sbi, curseg)
#define stat_inc_block_count(sbi, curseg)
#define stat_inc_seg_count(si, type)
#define stat_inc_seg_count(si, type)
#define stat_inc_tot_blk_count(si, blks)
#define stat_inc_tot_blk_count(si, blks)
#define stat_inc_data_blk_count(si, blks)
#define stat_inc_data_blk_count(si, blks)
+1 −3
Original line number Original line Diff line number Diff line
@@ -77,9 +77,7 @@ static int gc_thread_func(void *data)
		else
		else
			wait_ms = increase_sleep_time(gc_th, wait_ms);
			wait_ms = increase_sleep_time(gc_th, wait_ms);


#ifdef CONFIG_F2FS_STAT_FS
		stat_inc_bggc_count(sbi);
		sbi->bg_gc++;
#endif


		/* if return value is not zero, no victim was selected */
		/* if return value is not zero, no victim was selected */
		if (f2fs_gc(sbi))
		if (f2fs_gc(sbi))
+4 −6
Original line number Original line Diff line number Diff line
@@ -554,9 +554,8 @@ static void allocate_segment_by_default(struct f2fs_sb_info *sbi,
		change_curseg(sbi, type, true);
		change_curseg(sbi, type, true);
	else
	else
		new_curseg(sbi, type, false);
		new_curseg(sbi, type, false);
#ifdef CONFIG_F2FS_STAT_FS

	sbi->segment_count[curseg->alloc_type]++;
	stat_inc_seg_type(sbi, curseg);
#endif
}
}


void allocate_new_segments(struct f2fs_sb_info *sbi)
void allocate_new_segments(struct f2fs_sb_info *sbi)
@@ -811,9 +810,8 @@ static void do_write_page(struct f2fs_sb_info *sbi, struct page *page,


	mutex_lock(&sit_i->sentry_lock);
	mutex_lock(&sit_i->sentry_lock);
	__refresh_next_blkoff(sbi, curseg);
	__refresh_next_blkoff(sbi, curseg);
#ifdef CONFIG_F2FS_STAT_FS

	sbi->block_count[curseg->alloc_type]++;
	stat_inc_block_count(sbi, curseg);
#endif


	/*
	/*
	 * SIT information should be updated before segment allocation,
	 * SIT information should be updated before segment allocation,