diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-10-22 07:56:10 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-10-25 03:54:08 -0400 |
commit | dcdfff65276fdc6dfe5eb1d0aff802dfa7a95e15 (patch) | |
tree | b5461b18a242ea5fd04eb4c69e5cb966708c9e19 /fs/f2fs | |
parent | 7bd59381c82defe19875284c48b1ac9dacd16e8f (diff) |
f2fs: clean up several status-related operations
This patch cleans up improper definitions that update some status information.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/checkpoint.c | 8 | ||||
-rw-r--r-- | fs/f2fs/data.c | 12 | ||||
-rw-r--r-- | fs/f2fs/f2fs.h | 18 | ||||
-rw-r--r-- | fs/f2fs/gc.c | 4 | ||||
-rw-r--r-- | fs/f2fs/segment.c | 10 |
5 files changed, 27 insertions, 25 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 6fb484c84ee7..b4a59cf99f1c 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c | |||
@@ -467,9 +467,7 @@ static int __add_dirty_inode(struct inode *inode, struct dir_inode_entry *new) | |||
467 | return -EEXIST; | 467 | return -EEXIST; |
468 | } | 468 | } |
469 | list_add_tail(&new->list, head); | 469 | list_add_tail(&new->list, head); |
470 | #ifdef CONFIG_F2FS_STAT_FS | 470 | stat_inc_dirty_dir(sbi); |
471 | sbi->n_dirty_dirs++; | ||
472 | #endif | ||
473 | return 0; | 471 | return 0; |
474 | } | 472 | } |
475 | 473 | ||
@@ -531,9 +529,7 @@ void remove_dirty_dir_inode(struct inode *inode) | |||
531 | if (entry->inode == inode) { | 529 | if (entry->inode == inode) { |
532 | list_del(&entry->list); | 530 | list_del(&entry->list); |
533 | kmem_cache_free(inode_entry_slab, entry); | 531 | kmem_cache_free(inode_entry_slab, entry); |
534 | #ifdef CONFIG_F2FS_STAT_FS | 532 | stat_dec_dirty_dir(sbi); |
535 | sbi->n_dirty_dirs--; | ||
536 | #endif | ||
537 | break; | 533 | break; |
538 | } | 534 | } |
539 | } | 535 | } |
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 2535d3b1a763..1cccf98f0e4d 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -68,9 +68,6 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs, | |||
68 | struct buffer_head *bh_result) | 68 | struct buffer_head *bh_result) |
69 | { | 69 | { |
70 | struct f2fs_inode_info *fi = F2FS_I(inode); | 70 | struct f2fs_inode_info *fi = F2FS_I(inode); |
71 | #ifdef CONFIG_F2FS_STAT_FS | ||
72 | struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); | ||
73 | #endif | ||
74 | pgoff_t start_fofs, end_fofs; | 71 | pgoff_t start_fofs, end_fofs; |
75 | block_t start_blkaddr; | 72 | block_t start_blkaddr; |
76 | 73 | ||
@@ -80,9 +77,8 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs, | |||
80 | return 0; | 77 | return 0; |
81 | } | 78 | } |
82 | 79 | ||
83 | #ifdef CONFIG_F2FS_STAT_FS | 80 | stat_inc_total_hit(inode->i_sb); |
84 | sbi->total_hit_ext++; | 81 | |
85 | #endif | ||
86 | start_fofs = fi->ext.fofs; | 82 | start_fofs = fi->ext.fofs; |
87 | end_fofs = fi->ext.fofs + fi->ext.len - 1; | 83 | end_fofs = fi->ext.fofs + fi->ext.len - 1; |
88 | start_blkaddr = fi->ext.blk_addr; | 84 | start_blkaddr = fi->ext.blk_addr; |
@@ -100,9 +96,7 @@ static int check_extent_cache(struct inode *inode, pgoff_t pgofs, | |||
100 | else | 96 | else |
101 | bh_result->b_size = UINT_MAX; | 97 | bh_result->b_size = UINT_MAX; |
102 | 98 | ||
103 | #ifdef CONFIG_F2FS_STAT_FS | 99 | stat_inc_read_hit(inode->i_sb); |
104 | sbi->read_hit_ext++; | ||
105 | #endif | ||
106 | read_unlock(&fi->ext.ext_lock); | 100 | read_unlock(&fi->ext.ext_lock); |
107 | return 1; | 101 | return 1; |
108 | } | 102 | } |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 29492754bd7d..7ca8c30d8d76 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -1155,7 +1155,16 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi) | |||
1155 | return (struct f2fs_stat_info*)sbi->stat_info; | 1155 | return (struct f2fs_stat_info*)sbi->stat_info; |
1156 | } | 1156 | } |
1157 | 1157 | ||
1158 | #define stat_inc_call_count(si) ((si)->call_count++) | 1158 | #define stat_inc_call_count(si) ((si)->call_count++) |
1159 | #define stat_inc_bggc_count(sbi) ((sbi)->bg_gc++) | ||
1160 | #define stat_inc_dirty_dir(sbi) ((sbi)->n_dirty_dirs++) | ||
1161 | #define stat_dec_dirty_dir(sbi) ((sbi)->n_dirty_dirs--) | ||
1162 | #define stat_inc_total_hit(sb) ((F2FS_SB(sb))->total_hit_ext++) | ||
1163 | #define stat_inc_read_hit(sb) ((F2FS_SB(sb))->read_hit_ext++) | ||
1164 | #define stat_inc_seg_type(sbi, curseg) \ | ||
1165 | ((sbi)->segment_count[(curseg)->alloc_type]++) | ||
1166 | #define stat_inc_block_count(sbi, curseg) \ | ||
1167 | ((sbi)->block_count[(curseg)->alloc_type]++) | ||
1159 | 1168 | ||
1160 | #define stat_inc_seg_count(sbi, type) \ | 1169 | #define stat_inc_seg_count(sbi, type) \ |
1161 | do { \ | 1170 | do { \ |
@@ -1190,6 +1199,13 @@ void __init f2fs_create_root_stats(void); | |||
1190 | void f2fs_destroy_root_stats(void); | 1199 | void f2fs_destroy_root_stats(void); |
1191 | #else | 1200 | #else |
1192 | #define stat_inc_call_count(si) | 1201 | #define stat_inc_call_count(si) |
1202 | #define stat_inc_bggc_count(si) | ||
1203 | #define stat_inc_dirty_dir(sbi) | ||
1204 | #define stat_dec_dirty_dir(sbi) | ||
1205 | #define stat_inc_total_hit(sb) | ||
1206 | #define stat_inc_read_hit(sb) | ||
1207 | #define stat_inc_seg_type(sbi, curseg) | ||
1208 | #define stat_inc_block_count(sbi, curseg) | ||
1193 | #define stat_inc_seg_count(si, type) | 1209 | #define stat_inc_seg_count(si, type) |
1194 | #define stat_inc_tot_blk_count(si, blks) | 1210 | #define stat_inc_tot_blk_count(si, blks) |
1195 | #define stat_inc_data_blk_count(si, blks) | 1211 | #define stat_inc_data_blk_count(si, blks) |
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 7914b92a6967..cb286d7b02b2 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c | |||
@@ -77,9 +77,7 @@ static int gc_thread_func(void *data) | |||
77 | else | 77 | else |
78 | wait_ms = increase_sleep_time(gc_th, wait_ms); | 78 | wait_ms = increase_sleep_time(gc_th, wait_ms); |
79 | 79 | ||
80 | #ifdef CONFIG_F2FS_STAT_FS | 80 | stat_inc_bggc_count(sbi); |
81 | sbi->bg_gc++; | ||
82 | #endif | ||
83 | 81 | ||
84 | /* if return value is not zero, no victim was selected */ | 82 | /* if return value is not zero, no victim was selected */ |
85 | if (f2fs_gc(sbi)) | 83 | if (f2fs_gc(sbi)) |
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 8ac161965242..177a33b16b2c 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
@@ -554,9 +554,8 @@ static void allocate_segment_by_default(struct f2fs_sb_info *sbi, | |||
554 | change_curseg(sbi, type, true); | 554 | change_curseg(sbi, type, true); |
555 | else | 555 | else |
556 | new_curseg(sbi, type, false); | 556 | new_curseg(sbi, type, false); |
557 | #ifdef CONFIG_F2FS_STAT_FS | 557 | |
558 | sbi->segment_count[curseg->alloc_type]++; | 558 | stat_inc_seg_type(sbi, curseg); |
559 | #endif | ||
560 | } | 559 | } |
561 | 560 | ||
562 | void allocate_new_segments(struct f2fs_sb_info *sbi) | 561 | 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, | |||
811 | 810 | ||
812 | mutex_lock(&sit_i->sentry_lock); | 811 | mutex_lock(&sit_i->sentry_lock); |
813 | __refresh_next_blkoff(sbi, curseg); | 812 | __refresh_next_blkoff(sbi, curseg); |
814 | #ifdef CONFIG_F2FS_STAT_FS | 813 | |
815 | sbi->block_count[curseg->alloc_type]++; | 814 | stat_inc_block_count(sbi, curseg); |
816 | #endif | ||
817 | 815 | ||
818 | /* | 816 | /* |
819 | * SIT information should be updated before segment allocation, | 817 | * SIT information should be updated before segment allocation, |