aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/budget.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/budget.c')
-rw-r--r--fs/ubifs/budget.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c
index f6d2eaa7a067..9ef630a594ca 100644
--- a/fs/ubifs/budget.c
+++ b/fs/ubifs/budget.c
@@ -709,24 +709,11 @@ void ubifs_release_dirty_inode_budget(struct ubifs_info *c,
709 */ 709 */
710long long ubifs_budg_get_free_space(struct ubifs_info *c) 710long long ubifs_budg_get_free_space(struct ubifs_info *c)
711{ 711{
712 int min_idx_lebs, rsvd_idx_lebs; 712 int min_idx_lebs;
713 long long available, outstanding, free; 713 long long available, outstanding, free;
714 714
715 /* Do exactly the same calculations as in 'do_budget_space()' */
716 spin_lock(&c->space_lock); 715 spin_lock(&c->space_lock);
717 min_idx_lebs = ubifs_calc_min_idx_lebs(c); 716 min_idx_lebs = ubifs_calc_min_idx_lebs(c);
718
719 if (min_idx_lebs > c->lst.idx_lebs)
720 rsvd_idx_lebs = min_idx_lebs - c->lst.idx_lebs;
721 else
722 rsvd_idx_lebs = 0;
723
724 if (rsvd_idx_lebs > c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt
725 - c->lst.taken_empty_lebs) {
726 spin_unlock(&c->space_lock);
727 return 0;
728 }
729
730 outstanding = c->budg_data_growth + c->budg_dd_growth; 717 outstanding = c->budg_data_growth + c->budg_dd_growth;
731 718
732 /* 719 /*