diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-03-30 23:39:49 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-04-03 03:23:10 -0400 |
commit | 53cf95222fad7a962cc03fb61a33e37bcf4f5c9d (patch) | |
tree | d908690ba50571d23a55bcb788d8b1c4cd92c5b6 /fs/f2fs/debug.c | |
parent | 5c773ba33a29c0dcddac7cfaa39fc63a7137130d (diff) |
f2fs: introduce TOTAL_SECS macro
Let's use a macro to get the total number of sections.
Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r-- | fs/f2fs/debug.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c index 025b9e2f935d..20b8794ec8f6 100644 --- a/fs/f2fs/debug.c +++ b/fs/f2fs/debug.c | |||
@@ -106,7 +106,7 @@ static void update_sit_info(struct f2fs_sb_info *sbi) | |||
106 | } | 106 | } |
107 | } | 107 | } |
108 | mutex_unlock(&sit_i->sentry_lock); | 108 | mutex_unlock(&sit_i->sentry_lock); |
109 | dist = sbi->total_sections * hblks_per_sec * hblks_per_sec / 100; | 109 | dist = TOTAL_SECS(sbi) * hblks_per_sec * hblks_per_sec / 100; |
110 | si->bimodal = bimodal / dist; | 110 | si->bimodal = bimodal / dist; |
111 | if (si->dirty_count) | 111 | if (si->dirty_count) |
112 | si->avg_vblocks = total_vblocks / ndirty; | 112 | si->avg_vblocks = total_vblocks / ndirty; |
@@ -138,14 +138,13 @@ static void update_mem_info(struct f2fs_sb_info *sbi) | |||
138 | si->base_mem += f2fs_bitmap_size(TOTAL_SEGS(sbi)); | 138 | si->base_mem += f2fs_bitmap_size(TOTAL_SEGS(sbi)); |
139 | si->base_mem += 2 * SIT_VBLOCK_MAP_SIZE * TOTAL_SEGS(sbi); | 139 | si->base_mem += 2 * SIT_VBLOCK_MAP_SIZE * TOTAL_SEGS(sbi); |
140 | if (sbi->segs_per_sec > 1) | 140 | if (sbi->segs_per_sec > 1) |
141 | si->base_mem += sbi->total_sections * | 141 | si->base_mem += TOTAL_SECS(sbi) * sizeof(struct sec_entry); |
142 | sizeof(struct sec_entry); | ||
143 | si->base_mem += __bitmap_size(sbi, SIT_BITMAP); | 142 | si->base_mem += __bitmap_size(sbi, SIT_BITMAP); |
144 | 143 | ||
145 | /* build free segmap */ | 144 | /* build free segmap */ |
146 | si->base_mem += sizeof(struct free_segmap_info); | 145 | si->base_mem += sizeof(struct free_segmap_info); |
147 | si->base_mem += f2fs_bitmap_size(TOTAL_SEGS(sbi)); | 146 | si->base_mem += f2fs_bitmap_size(TOTAL_SEGS(sbi)); |
148 | si->base_mem += f2fs_bitmap_size(sbi->total_sections); | 147 | si->base_mem += f2fs_bitmap_size(TOTAL_SECS(sbi)); |
149 | 148 | ||
150 | /* build curseg */ | 149 | /* build curseg */ |
151 | si->base_mem += sizeof(struct curseg_info) * NR_CURSEG_TYPE; | 150 | si->base_mem += sizeof(struct curseg_info) * NR_CURSEG_TYPE; |