aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-08-20 04:56:33 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-09-30 04:12:55 -0400
commit948cfb219bbbc3c8e1b10a671ca88219fa42a052 (patch)
treeffe2196bfeea90616c9dab8061132868a59f94ed
parent94aca1dac6f6d21f4b07e4864baf7768cabcc6e7 (diff)
UBIFS: add a print, fix comments and more minor stuff
This commit adds a reserved pool size print and tweaks the prints to make them look nicer. It also fixes and cleans-up some comments. Additionally, it deletes some blank lines to make the code look a little nicer. In other words, nothing essential. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--fs/ubifs/budget.c26
-rw-r--r--fs/ubifs/lprops.c6
-rw-r--r--fs/ubifs/super.c16
3 files changed, 24 insertions, 24 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c
index 73db464cd08b..1a4973e10664 100644
--- a/fs/ubifs/budget.c
+++ b/fs/ubifs/budget.c
@@ -414,19 +414,21 @@ static int do_budget_space(struct ubifs_info *c)
414 * @c->lst.empty_lebs + @c->freeable_cnt + @c->idx_gc_cnt - 414 * @c->lst.empty_lebs + @c->freeable_cnt + @c->idx_gc_cnt -
415 * @c->lst.taken_empty_lebs 415 * @c->lst.taken_empty_lebs
416 * 416 *
417 * @empty_lebs are available because they are empty. @freeable_cnt are 417 * @c->lst.empty_lebs are available because they are empty.
418 * available because they contain only free and dirty space and the 418 * @c->freeable_cnt are available because they contain only free and
419 * index allocation always occurs after wbufs are synch'ed. 419 * dirty space, @c->idx_gc_cnt are available because they are index
420 * @idx_gc_cnt are available because they are index LEBs that have been 420 * LEBs that have been garbage collected and are awaiting the commit
421 * garbage collected (including trivial GC) and are awaiting the commit 421 * before they can be used. And the in-the-gaps method will grab these
422 * before they can be unmapped - note that the in-the-gaps method will 422 * if it needs them. @c->lst.taken_empty_lebs are empty LEBs that have
423 * grab these if it needs them. @taken_empty_lebs are empty_lebs that 423 * already been allocated for some purpose.
424 * have already been allocated for some purpose (also includes those
425 * LEBs on the @idx_gc list).
426 * 424 *
427 * Note, @taken_empty_lebs may temporarily be higher by one because of 425 * Note, @c->idx_gc_cnt is included to both @c->lst.empty_lebs (because
428 * the way we serialize LEB allocations and budgeting. See a comment in 426 * these LEBs are empty) and to @c->lst.taken_empty_lebs (because they
429 * 'ubifs_find_free_space()'. 427 * are taken until after the commit).
428 *
429 * Note, @c->lst.taken_empty_lebs may temporarily be higher by one
430 * because of the way we serialize LEB allocations and budgeting. See a
431 * comment in 'ubifs_find_free_space()'.
430 */ 432 */
431 lebs = c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt - 433 lebs = c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt -
432 c->lst.taken_empty_lebs; 434 c->lst.taken_empty_lebs;
diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c
index 2ba93da71b65..3659b887743b 100644
--- a/fs/ubifs/lprops.c
+++ b/fs/ubifs/lprops.c
@@ -125,6 +125,7 @@ static void adjust_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap,
125 } 125 }
126 } 126 }
127 } 127 }
128
128 /* Not greater than parent, so compare to children */ 129 /* Not greater than parent, so compare to children */
129 while (1) { 130 while (1) {
130 /* Compare to left child */ 131 /* Compare to left child */
@@ -576,7 +577,6 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c,
576 ubifs_assert(!(lprops->free & 7) && !(lprops->dirty & 7)); 577 ubifs_assert(!(lprops->free & 7) && !(lprops->dirty & 7));
577 578
578 spin_lock(&c->space_lock); 579 spin_lock(&c->space_lock);
579
580 if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size) 580 if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size)
581 c->lst.taken_empty_lebs -= 1; 581 c->lst.taken_empty_lebs -= 1;
582 582
@@ -637,11 +637,8 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c,
637 c->lst.taken_empty_lebs += 1; 637 c->lst.taken_empty_lebs += 1;
638 638
639 change_category(c, lprops); 639 change_category(c, lprops);
640
641 c->idx_gc_cnt += idx_gc_cnt; 640 c->idx_gc_cnt += idx_gc_cnt;
642
643 spin_unlock(&c->space_lock); 641 spin_unlock(&c->space_lock);
644
645 return lprops; 642 return lprops;
646} 643}
647 644
@@ -1262,7 +1259,6 @@ static int scan_check_cb(struct ubifs_info *c,
1262 } 1259 }
1263 1260
1264 ubifs_scan_destroy(sleb); 1261 ubifs_scan_destroy(sleb);
1265
1266 return LPT_SCAN_CONTINUE; 1262 return LPT_SCAN_CONTINUE;
1267 1263
1268out_print: 1264out_print:
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 3f4902060c7a..667c72d8a5cc 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1144,19 +1144,21 @@ static int mount_ubifs(struct ubifs_info *c)
1144 if (mounted_read_only) 1144 if (mounted_read_only)
1145 ubifs_msg("mounted read-only"); 1145 ubifs_msg("mounted read-only");
1146 x = (long long)c->main_lebs * c->leb_size; 1146 x = (long long)c->main_lebs * c->leb_size;
1147 ubifs_msg("file system size: %lld bytes (%lld KiB, %lld MiB, %d LEBs)", 1147 ubifs_msg("file system size: %lld bytes (%lld KiB, %lld MiB, %d "
1148 x, x >> 10, x >> 20, c->main_lebs); 1148 "LEBs)", x, x >> 10, x >> 20, c->main_lebs);
1149 x = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes; 1149 x = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes;
1150 ubifs_msg("journal size: %lld bytes (%lld KiB, %lld MiB, %d LEBs)", 1150 ubifs_msg("journal size: %lld bytes (%lld KiB, %lld MiB, %d "
1151 x, x >> 10, x >> 20, c->log_lebs + c->max_bud_cnt); 1151 "LEBs)", x, x >> 10, x >> 20, c->log_lebs + c->max_bud_cnt);
1152 ubifs_msg("default compressor: %s", ubifs_compr_name(c->default_compr)); 1152 ubifs_msg("media format: %d (latest is %d)",
1153 ubifs_msg("media format %d, latest format %d",
1154 c->fmt_version, UBIFS_FORMAT_VERSION); 1153 c->fmt_version, UBIFS_FORMAT_VERSION);
1154 ubifs_msg("default compressor: %s", ubifs_compr_name(c->default_compr));
1155 ubifs_msg("reserved pool size: %llu bytes (%llu KiB)",
1156 c->report_rp_size, c->report_rp_size >> 10);
1155 1157
1156 dbg_msg("compiled on: " __DATE__ " at " __TIME__); 1158 dbg_msg("compiled on: " __DATE__ " at " __TIME__);
1157 dbg_msg("min. I/O unit size: %d bytes", c->min_io_size); 1159 dbg_msg("min. I/O unit size: %d bytes", c->min_io_size);
1158 dbg_msg("LEB size: %d bytes (%d KiB)", 1160 dbg_msg("LEB size: %d bytes (%d KiB)",
1159 c->leb_size, c->leb_size / 1024); 1161 c->leb_size, c->leb_size >> 10);
1160 dbg_msg("data journal heads: %d", 1162 dbg_msg("data journal heads: %d",
1161 c->jhead_cnt - NONDATA_JHEADS_CNT); 1163 c->jhead_cnt - NONDATA_JHEADS_CNT);
1162 dbg_msg("UUID: %02X%02X%02X%02X-%02X%02X" 1164 dbg_msg("UUID: %02X%02X%02X%02X-%02X%02X"