Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109715
b: refs/heads/master
c: 9e5de35
h: refs/heads/master
i:
  109713: e33a454
  109711: 2302da0
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Aug 31, 2008
1 parent 46d468d commit 702d657
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8191e1fa8131a422f4bf7b0f2dc1f8543fd17783
refs/heads/master: 9e5de3549615818cae9c20a0ee1fd3ad4a747758
24 changes: 11 additions & 13 deletions trunk/fs/ubifs/budget.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,6 @@ long long ubifs_calc_available(const struct ubifs_info *c, int min_idx_lebs)
int subtract_lebs;
long long available;

/*
* Force the amount available to the total size reported if the used
* space is zero.
*/
if (c->lst.total_used <= UBIFS_INO_NODE_SZ &&
c->budg_data_growth + c->budg_dd_growth == 0) {
/* Do the same calculation as for c->block_cnt */
available = c->main_lebs - 2;
available *= c->leb_size - c->dark_wm;
return available;
}

available = c->main_bytes - c->lst.total_used;

/*
Expand Down Expand Up @@ -739,8 +727,18 @@ long long ubifs_budg_get_free_space(struct ubifs_info *c)
return 0;
}

available = ubifs_calc_available(c, min_idx_lebs);
outstanding = c->budg_data_growth + c->budg_dd_growth;

/*
* Force the amount available to the total size reported if the used
* space is zero.
*/
if (c->lst.total_used <= UBIFS_INO_NODE_SZ && !outstanding) {
spin_unlock(&c->space_lock);
return (long long)c->block_cnt << UBIFS_BLOCK_SHIFT;
}

available = ubifs_calc_available(c, min_idx_lebs);
spin_unlock(&c->space_lock);

if (available > outstanding)
Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,6 @@ static int init_constants_late(struct ubifs_info *c)
*
* Subtract the LEB reserved for GC and the LEB which is reserved for
* deletions.
*
* Review 'ubifs_calc_available()' if changing this calculation.
*/
tmp64 = c->main_lebs - 2;
tmp64 *= (uint64_t)c->leb_size - c->dark_wm;
Expand Down

0 comments on commit 702d657

Please sign in to comment.