aboutsummaryrefslogtreecommitdiffstats
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 05:22:58 -0500
commit21a60258976227daaf7a4c35e96c3d77d4988b15 (patch)
tree73c9de022a0a947ca4f5e8d8edfdbd8321270464
parent24fa9e9438b263600737c839b36543981d87d65b (diff)
UBIFS: improve budgeting dump
Dump available space calculated by budgeting subsystem. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--fs/ubifs/budget.c4
-rw-r--r--fs/ubifs/debug.c13
-rw-r--r--fs/ubifs/ubifs.h2
3 files changed, 16 insertions, 3 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c
index 1a4973e10664..d5a65037e172 100644
--- a/fs/ubifs/budget.c
+++ b/fs/ubifs/budget.c
@@ -713,8 +713,8 @@ void ubifs_release_dirty_inode_budget(struct ubifs_info *c,
713 * (e.g., via the 'statfs()' call) reports that it has N bytes available, they 713 * (e.g., via the 'statfs()' call) reports that it has N bytes available, they
714 * are able to write a file of size N. UBIFS attaches node headers to each data 714 * are able to write a file of size N. UBIFS attaches node headers to each data
715 * node and it has to write indexind nodes as well. This introduces additional 715 * node and it has to write indexind nodes as well. This introduces additional
716 * overhead, and UBIFS it has to report sligtly less free space to meet the 716 * overhead, and UBIFS has to report sligtly less free space to meet the above
717 * above expectetion. 717 * expectetions.
718 * 718 *
719 * This function assumes free space is made up of uncompressed data nodes and 719 * This function assumes free space is made up of uncompressed data nodes and
720 * full index nodes (one per data node, tripled because we always allow enough 720 * full index nodes (one per data node, tripled because we always allow enough
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
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 055c6b52d2f6..e61c08106b47 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -419,7 +419,7 @@ struct ubifs_unclean_leb {
419 * 419 *
420 * LPROPS_UNCAT: not categorized 420 * LPROPS_UNCAT: not categorized
421 * LPROPS_DIRTY: dirty > 0, not index 421 * LPROPS_DIRTY: dirty > 0, not index
422 * LPROPS_DIRTY_IDX: dirty + free > UBIFS_CH_SZ and index 422 * LPROPS_DIRTY_IDX: dirty + free > @c->min_idx_node_sze and index
423 * LPROPS_FREE: free > 0, not empty, not index 423 * LPROPS_FREE: free > 0, not empty, not index
424 * LPROPS_HEAP_CNT: number of heaps used for storing categorized LEBs 424 * LPROPS_HEAP_CNT: number of heaps used for storing categorized LEBs
425 * LPROPS_EMPTY: LEB is empty, not taken 425 * LPROPS_EMPTY: LEB is empty, not taken