aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/debug.c
diff options
context:
space:
mode:
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)
597 struct rb_node *rb; 597 struct rb_node *rb;
598 struct ubifs_bud *bud; 598 struct ubifs_bud *bud;
599 struct ubifs_gced_idx_leb *idx_gc; 599 struct ubifs_gced_idx_leb *idx_gc;
600 long long available, outstanding, free;
600 601
602 ubifs_assert(spin_is_locked(&c->space_lock));
601 spin_lock(&dbg_lock); 603 spin_lock(&dbg_lock);
602 printk(KERN_DEBUG "(pid %d) Budgeting info: budg_data_growth %lld, " 604 printk(KERN_DEBUG "(pid %d) Budgeting info: budg_data_growth %lld, "
603 "budg_dd_growth %lld, budg_idx_growth %lld\n", current->pid, 605 "budg_dd_growth %lld, budg_idx_growth %lld\n", current->pid,
@@ -630,6 +632,17 @@ void dbg_dump_budg(struct ubifs_info *c)
630 printk(KERN_DEBUG "\tGC'ed idx LEB %d unmap %d\n", 632 printk(KERN_DEBUG "\tGC'ed idx LEB %d unmap %d\n",
631 idx_gc->lnum, idx_gc->unmap); 633 idx_gc->lnum, idx_gc->unmap);
632 printk(KERN_DEBUG "\tcommit state %d\n", c->cmt_state); 634 printk(KERN_DEBUG "\tcommit state %d\n", c->cmt_state);
635
636 /* Print budgeting predictions */
637 available = ubifs_calc_available(c, c->min_idx_lebs);
638 outstanding = c->budg_data_growth + c->budg_dd_growth;
639 if (available > outstanding)
640 free = ubifs_reported_space(c, available - outstanding);
641 else
642 free = 0;
643 printk(KERN_DEBUG "Budgeting predictions:\n");
644 printk(KERN_DEBUG "\tavailable: %lld, outstanding %lld, free %lld\n",
645 available, outstanding, free);
633 spin_unlock(&dbg_lock); 646 spin_unlock(&dbg_lock);
634} 647}
635 648