Commit 948cfb21 authored by Artem Bityutskiy's avatar Artem Bityutskiy

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: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 94aca1da
...@@ -414,19 +414,21 @@ static int do_budget_space(struct ubifs_info *c) ...@@ -414,19 +414,21 @@ static int do_budget_space(struct ubifs_info *c)
* @c->lst.empty_lebs + @c->freeable_cnt + @c->idx_gc_cnt - * @c->lst.empty_lebs + @c->freeable_cnt + @c->idx_gc_cnt -
* @c->lst.taken_empty_lebs * @c->lst.taken_empty_lebs
* *
* @empty_lebs are available because they are empty. @freeable_cnt are * @c->lst.empty_lebs are available because they are empty.
* available because they contain only free and dirty space and the * @c->freeable_cnt are available because they contain only free and
* index allocation always occurs after wbufs are synch'ed. * dirty space, @c->idx_gc_cnt are available because they are index
* @idx_gc_cnt are available because they are index LEBs that have been * LEBs that have been garbage collected and are awaiting the commit
* garbage collected (including trivial GC) and are awaiting the commit * before they can be used. And the in-the-gaps method will grab these
* before they can be unmapped - note that the in-the-gaps method will * if it needs them. @c->lst.taken_empty_lebs are empty LEBs that have
* grab these if it needs them. @taken_empty_lebs are empty_lebs that * already been allocated for some purpose.
* have already been allocated for some purpose (also includes those *
* LEBs on the @idx_gc list). * Note, @c->idx_gc_cnt is included to both @c->lst.empty_lebs (because
* * these LEBs are empty) and to @c->lst.taken_empty_lebs (because they
* Note, @taken_empty_lebs may temporarily be higher by one because of * are taken until after the commit).
* the way we serialize LEB allocations and budgeting. See a comment in *
* 'ubifs_find_free_space()'. * Note, @c->lst.taken_empty_lebs may temporarily be higher by one
* because of the way we serialize LEB allocations and budgeting. See a
* comment in 'ubifs_find_free_space()'.
*/ */
lebs = c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt - lebs = c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt -
c->lst.taken_empty_lebs; c->lst.taken_empty_lebs;
......
...@@ -125,6 +125,7 @@ static void adjust_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, ...@@ -125,6 +125,7 @@ static void adjust_lpt_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap,
} }
} }
} }
/* Not greater than parent, so compare to children */ /* Not greater than parent, so compare to children */
while (1) { while (1) {
/* Compare to left child */ /* Compare to left child */
...@@ -576,7 +577,6 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c, ...@@ -576,7 +577,6 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c,
ubifs_assert(!(lprops->free & 7) && !(lprops->dirty & 7)); ubifs_assert(!(lprops->free & 7) && !(lprops->dirty & 7));
spin_lock(&c->space_lock); spin_lock(&c->space_lock);
if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size) if ((lprops->flags & LPROPS_TAKEN) && lprops->free == c->leb_size)
c->lst.taken_empty_lebs -= 1; c->lst.taken_empty_lebs -= 1;
...@@ -637,11 +637,8 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c, ...@@ -637,11 +637,8 @@ const struct ubifs_lprops *ubifs_change_lp(struct ubifs_info *c,
c->lst.taken_empty_lebs += 1; c->lst.taken_empty_lebs += 1;
change_category(c, lprops); change_category(c, lprops);
c->idx_gc_cnt += idx_gc_cnt; c->idx_gc_cnt += idx_gc_cnt;
spin_unlock(&c->space_lock); spin_unlock(&c->space_lock);
return lprops; return lprops;
} }
...@@ -1262,7 +1259,6 @@ static int scan_check_cb(struct ubifs_info *c, ...@@ -1262,7 +1259,6 @@ static int scan_check_cb(struct ubifs_info *c,
} }
ubifs_scan_destroy(sleb); ubifs_scan_destroy(sleb);
return LPT_SCAN_CONTINUE; return LPT_SCAN_CONTINUE;
out_print: out_print:
......
...@@ -1144,19 +1144,21 @@ static int mount_ubifs(struct ubifs_info *c) ...@@ -1144,19 +1144,21 @@ static int mount_ubifs(struct ubifs_info *c)
if (mounted_read_only) if (mounted_read_only)
ubifs_msg("mounted read-only"); ubifs_msg("mounted read-only");
x = (long long)c->main_lebs * c->leb_size; x = (long long)c->main_lebs * c->leb_size;
ubifs_msg("file system size: %lld bytes (%lld KiB, %lld MiB, %d LEBs)", ubifs_msg("file system size: %lld bytes (%lld KiB, %lld MiB, %d "
x, x >> 10, x >> 20, c->main_lebs); "LEBs)", x, x >> 10, x >> 20, c->main_lebs);
x = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes; x = (long long)c->log_lebs * c->leb_size + c->max_bud_bytes;
ubifs_msg("journal size: %lld bytes (%lld KiB, %lld MiB, %d LEBs)", ubifs_msg("journal size: %lld bytes (%lld KiB, %lld MiB, %d "
x, x >> 10, x >> 20, c->log_lebs + c->max_bud_cnt); "LEBs)", x, x >> 10, x >> 20, c->log_lebs + c->max_bud_cnt);
ubifs_msg("default compressor: %s", ubifs_compr_name(c->default_compr)); ubifs_msg("media format: %d (latest is %d)",
ubifs_msg("media format %d, latest format %d",
c->fmt_version, UBIFS_FORMAT_VERSION); c->fmt_version, UBIFS_FORMAT_VERSION);
ubifs_msg("default compressor: %s", ubifs_compr_name(c->default_compr));
ubifs_msg("reserved pool size: %llu bytes (%llu KiB)",
c->report_rp_size, c->report_rp_size >> 10);
dbg_msg("compiled on: " __DATE__ " at " __TIME__); dbg_msg("compiled on: " __DATE__ " at " __TIME__);
dbg_msg("min. I/O unit size: %d bytes", c->min_io_size); dbg_msg("min. I/O unit size: %d bytes", c->min_io_size);
dbg_msg("LEB size: %d bytes (%d KiB)", dbg_msg("LEB size: %d bytes (%d KiB)",
c->leb_size, c->leb_size / 1024); c->leb_size, c->leb_size >> 10);
dbg_msg("data journal heads: %d", dbg_msg("data journal heads: %d",
c->jhead_cnt - NONDATA_JHEADS_CNT); c->jhead_cnt - NONDATA_JHEADS_CNT);
dbg_msg("UUID: %02X%02X%02X%02X-%02X%02X" dbg_msg("UUID: %02X%02X%02X%02X-%02X%02X"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment