diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-12-19 12:26:29 -0500 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-12-23 05:23:29 -0500 |
commit | af14a1ad792621942a03e4bd0e5f17b6e177e2e0 (patch) | |
tree | b91e77a8a1a373ca3dfcc84ec0feb243fb74e2e5 /fs/ubifs/budget.c | |
parent | d3cf502b6ccee1c52890d42cd18cbc98b7526126 (diff) |
UBIFS: fix available blocks count
Take into account that 2 eraseblocks are never available because
they are reserved for the index. This gives more realistic count
of FS blocks.
To avoid future confusions like this, introduce a constant.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/budget.c')
-rw-r--r-- | fs/ubifs/budget.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index d5a65037e172..e42342547001 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c | |||
@@ -280,13 +280,8 @@ int ubifs_calc_min_idx_lebs(struct ubifs_info *c) | |||
280 | * extra LEB to compensate. | 280 | * extra LEB to compensate. |
281 | */ | 281 | */ |
282 | ret += 1; | 282 | ret += 1; |
283 | /* | 283 | if (ret < MIN_INDEX_LEBS) |
284 | * At present the index needs at least 2 LEBs: one for the index head | 284 | ret = MIN_INDEX_LEBS; |
285 | * and one for in-the-gaps method (which currently does not cater for | ||
286 | * the index head and so excludes it from consideration). | ||
287 | */ | ||
288 | if (ret < 2) | ||
289 | ret = 2; | ||
290 | return ret; | 285 | return ret; |
291 | } | 286 | } |
292 | 287 | ||