diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-03-29 11:04:05 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-13 12:23:53 -0400 |
commit | b137545c44fc0c80fb778abb0c582bda5601e8f8 (patch) | |
tree | fb3da759a3c64587bee8bacf408cf774adb8b09a /fs/ubifs/find.c | |
parent | cc64f774b4acd4954abe54f5919f50d78aba1e5f (diff) |
UBIFS: introduce a separate structure for budgeting info
This patch separates out all the budgeting-related information
from 'struct ubifs_info' to 'struct ubifs_budg_info'. This way the
code looks a bit cleaner. However, the main driver for this is
that we want to save budgeting information and print it later,
so a separate data structure for this is helpful.
This patch is a preparation for the further debugging output
improvements.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/find.c')
-rw-r--r-- | fs/ubifs/find.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index 1d54383d1269..2559d174e004 100644 --- a/fs/ubifs/find.c +++ b/fs/ubifs/find.c | |||
@@ -252,8 +252,8 @@ int ubifs_find_dirty_leb(struct ubifs_info *c, struct ubifs_lprops *ret_lp, | |||
252 | * But if the index takes fewer LEBs than it is reserved for it, | 252 | * But if the index takes fewer LEBs than it is reserved for it, |
253 | * this function must avoid picking those reserved LEBs. | 253 | * this function must avoid picking those reserved LEBs. |
254 | */ | 254 | */ |
255 | if (c->min_idx_lebs >= c->lst.idx_lebs) { | 255 | if (c->bi.min_idx_lebs >= c->lst.idx_lebs) { |
256 | rsvd_idx_lebs = c->min_idx_lebs - c->lst.idx_lebs; | 256 | rsvd_idx_lebs = c->bi.min_idx_lebs - c->lst.idx_lebs; |
257 | exclude_index = 1; | 257 | exclude_index = 1; |
258 | } | 258 | } |
259 | spin_unlock(&c->space_lock); | 259 | spin_unlock(&c->space_lock); |
@@ -276,7 +276,7 @@ int ubifs_find_dirty_leb(struct ubifs_info *c, struct ubifs_lprops *ret_lp, | |||
276 | pick_free = 0; | 276 | pick_free = 0; |
277 | } else { | 277 | } else { |
278 | spin_lock(&c->space_lock); | 278 | spin_lock(&c->space_lock); |
279 | exclude_index = (c->min_idx_lebs >= c->lst.idx_lebs); | 279 | exclude_index = (c->bi.min_idx_lebs >= c->lst.idx_lebs); |
280 | spin_unlock(&c->space_lock); | 280 | spin_unlock(&c->space_lock); |
281 | } | 281 | } |
282 | 282 | ||
@@ -501,8 +501,8 @@ int ubifs_find_free_space(struct ubifs_info *c, int min_space, int *offs, | |||
501 | 501 | ||
502 | /* Check if there are enough empty LEBs for commit */ | 502 | /* Check if there are enough empty LEBs for commit */ |
503 | spin_lock(&c->space_lock); | 503 | spin_lock(&c->space_lock); |
504 | if (c->min_idx_lebs > c->lst.idx_lebs) | 504 | if (c->bi.min_idx_lebs > c->lst.idx_lebs) |
505 | rsvd_idx_lebs = c->min_idx_lebs - c->lst.idx_lebs; | 505 | rsvd_idx_lebs = c->bi.min_idx_lebs - c->lst.idx_lebs; |
506 | else | 506 | else |
507 | rsvd_idx_lebs = 0; | 507 | rsvd_idx_lebs = 0; |
508 | lebs = c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt - | 508 | lebs = c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt - |