summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/debug.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-12-12 11:13:17 -0500
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-12-23 12:22:58 +0200
commit21a60258976227daaf7a4c35e96c3d77d4988b15 (patch)
tree73c9de022a0a947ca4f5e8d8edfdbd8321270464 /fs/ubifs/debug.c
parent24fa9e9438b263600737c839b36543981d87d65b (diff)
downloadblackbird-obmc-linux-21a60258976227daaf7a4c35e96c3d77d4988b15.tar.gz
blackbird-obmc-linux-21a60258976227daaf7a4c35e96c3d77d4988b15.zip
UBIFS: improve budgeting dump
Dump available space calculated by budgeting subsystem. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/debug.c')
-rw-r--r--fs/ubifs/debug.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 367d97520d95..6ecb01a99d14 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -597,7 +597,9 @@ void dbg_dump_budg(struct ubifs_info *c)
struct rb_node *rb;
struct ubifs_bud *bud;
struct ubifs_gced_idx_leb *idx_gc;
+ long long available, outstanding, free;
+ ubifs_assert(spin_is_locked(&c->space_lock));
spin_lock(&dbg_lock);
printk(KERN_DEBUG "(pid %d) Budgeting info: budg_data_growth %lld, "
"budg_dd_growth %lld, budg_idx_growth %lld\n", current->pid,
@@ -630,6 +632,17 @@ void dbg_dump_budg(struct ubifs_info *c)
printk(KERN_DEBUG "\tGC'ed idx LEB %d unmap %d\n",
idx_gc->lnum, idx_gc->unmap);
printk(KERN_DEBUG "\tcommit state %d\n", c->cmt_state);
+
+ /* Print budgeting predictions */
+ available = ubifs_calc_available(c, c->min_idx_lebs);
+ outstanding = c->budg_data_growth + c->budg_dd_growth;
+ if (available > outstanding)
+ free = ubifs_reported_space(c, available - outstanding);
+ else
+ free = 0;
+ printk(KERN_DEBUG "Budgeting predictions:\n");
+ printk(KERN_DEBUG "\tavailable: %lld, outstanding %lld, free %lld\n",
+ available, outstanding, free);
spin_unlock(&dbg_lock);
}
OpenPOWER on IntegriCloud