summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/debug.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-04-07 18:08:17 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2017-04-10 22:48:13 -0400
commit4ddb1a4d4dc20642073b7d92400a67b67601fe6f (patch)
treec39f403ca64b70dedaad2b93b210e1b66fe99aa8 /fs/f2fs/debug.c
parent302bd34882b1e20797f08cc13ef060ec972d0acb (diff)
f2fs: clean up some macros in terms of GET_SEGNO
This patch cleans several macros by introducing: - BLKS_PER_SEC - GET_SEC_FROM_SEG - GET_SEG_FROM_SEC - GET_ZONE_FROM_SEC - GET_ZONE_FROM_SEG Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/debug.c')
-rw-r--r--fs/f2fs/debug.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/debug.c b/fs/f2fs/debug.c
index dc16a52db275..692beff66bf8 100644
--- a/fs/f2fs/debug.c
+++ b/fs/f2fs/debug.c
@@ -109,8 +109,8 @@ static void update_general_status(struct f2fs_sb_info *sbi)
109 for (i = CURSEG_HOT_DATA; i <= CURSEG_COLD_NODE; i++) { 109 for (i = CURSEG_HOT_DATA; i <= CURSEG_COLD_NODE; i++) {
110 struct curseg_info *curseg = CURSEG_I(sbi, i); 110 struct curseg_info *curseg = CURSEG_I(sbi, i);
111 si->curseg[i] = curseg->segno; 111 si->curseg[i] = curseg->segno;
112 si->cursec[i] = curseg->segno / sbi->segs_per_sec; 112 si->cursec[i] = GET_SEC_FROM_SEG(sbi, curseg->segno);
113 si->curzone[i] = si->cursec[i] / sbi->secs_per_zone; 113 si->curzone[i] = GET_ZONE_FROM_SEC(sbi, si->cursec[i]);
114 } 114 }
115 115
116 for (i = 0; i < 2; i++) { 116 for (i = 0; i < 2; i++) {
@@ -134,7 +134,7 @@ static void update_sit_info(struct f2fs_sb_info *sbi)
134 134
135 bimodal = 0; 135 bimodal = 0;
136 total_vblocks = 0; 136 total_vblocks = 0;
137 blks_per_sec = sbi->segs_per_sec * sbi->blocks_per_seg; 137 blks_per_sec = BLKS_PER_SEC(sbi);
138 hblks_per_sec = blks_per_sec / 2; 138 hblks_per_sec = blks_per_sec / 2;
139 for (segno = 0; segno < MAIN_SEGS(sbi); segno += sbi->segs_per_sec) { 139 for (segno = 0; segno < MAIN_SEGS(sbi); segno += sbi->segs_per_sec) {
140 vblocks = get_valid_blocks(sbi, segno, true); 140 vblocks = get_valid_blocks(sbi, segno, true);