diff options
Diffstat (limited to 'fs/ubifs/budget.c')
-rw-r--r-- | fs/ubifs/budget.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index a3978ba4215e..323d83a4d099 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c | |||
@@ -263,8 +263,8 @@ int ubifs_calc_min_idx_lebs(struct ubifs_info *c) | |||
263 | 263 | ||
264 | idx_size = c->old_idx_sz + c->budg_idx_growth + c->budg_uncommitted_idx; | 264 | idx_size = c->old_idx_sz + c->budg_idx_growth + c->budg_uncommitted_idx; |
265 | 265 | ||
266 | /* And make sure we have twice the index size of space reserved */ | 266 | /* And make sure we have trice the index size of space reserved */ |
267 | idx_size <<= 1; | 267 | idx_size = idx_size + (idx_size << 1); |
268 | 268 | ||
269 | /* | 269 | /* |
270 | * We do not maintain 'old_idx_size' as 'old_idx_lebs'/'old_idx_bytes' | 270 | * We do not maintain 'old_idx_size' as 'old_idx_lebs'/'old_idx_bytes' |
@@ -388,11 +388,11 @@ static int can_use_rp(struct ubifs_info *c) | |||
388 | * This function makes sure UBIFS has enough free eraseblocks for index growth | 388 | * This function makes sure UBIFS has enough free eraseblocks for index growth |
389 | * and data. | 389 | * and data. |
390 | * | 390 | * |
391 | * When budgeting index space, UBIFS reserves twice as more LEBs as the index | 391 | * When budgeting index space, UBIFS reserves trice as more LEBs as the index |
392 | * would take if it was consolidated and written to the flash. This guarantees | 392 | * would take if it was consolidated and written to the flash. This guarantees |
393 | * that the "in-the-gaps" commit method always succeeds and UBIFS will always | 393 | * that the "in-the-gaps" commit method always succeeds and UBIFS will always |
394 | * be able to commit dirty index. So this function basically adds amount of | 394 | * be able to commit dirty index. So this function basically adds amount of |
395 | * budgeted index space to the size of the current index, multiplies this by 2, | 395 | * budgeted index space to the size of the current index, multiplies this by 3, |
396 | * and makes sure this does not exceed the amount of free eraseblocks. | 396 | * and makes sure this does not exceed the amount of free eraseblocks. |
397 | * | 397 | * |
398 | * Notes about @c->min_idx_lebs and @c->lst.idx_lebs variables: | 398 | * Notes about @c->min_idx_lebs and @c->lst.idx_lebs variables: |