diff options
author | Adrian Hunter <adrian.hunter@nokia.com> | 2009-04-08 08:07:57 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-05-06 03:37:56 -0400 |
commit | 6d6cb0d688d0f262cb4fd5771648b0ac01d4f82c (patch) | |
tree | b4e0f50358029650f0047ffe1f9c48e24c420584 /fs/ubifs/budget.c | |
parent | 091438dd5668396328a3419abcbc6591159eb8d1 (diff) |
UBIFS: reset no_space flag after inode deletion
When UBIFS runs out of space it spends a lot of time trying to
find more space before returning ENOSPC. As there is no point
repeating that unless something has changed, UBIFS has an
optimization to record that the file system is 100% full and not
try to find space. That flag was not being reset when a pending
deletion was finally done.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Reviewed-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/budget.c')
-rw-r--r-- | fs/ubifs/budget.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index af1914462f02..d0231ba783df 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c | |||
@@ -628,7 +628,7 @@ void ubifs_convert_page_budget(struct ubifs_info *c) | |||
628 | * | 628 | * |
629 | * This function releases budget corresponding to a dirty inode. It is usually | 629 | * This function releases budget corresponding to a dirty inode. It is usually |
630 | * called when after the inode has been written to the media and marked as | 630 | * called when after the inode has been written to the media and marked as |
631 | * clean. | 631 | * clean. It also causes the "no space" flags to be cleared. |
632 | */ | 632 | */ |
633 | void ubifs_release_dirty_inode_budget(struct ubifs_info *c, | 633 | void ubifs_release_dirty_inode_budget(struct ubifs_info *c, |
634 | struct ubifs_inode *ui) | 634 | struct ubifs_inode *ui) |
@@ -636,6 +636,7 @@ void ubifs_release_dirty_inode_budget(struct ubifs_info *c, | |||
636 | struct ubifs_budget_req req; | 636 | struct ubifs_budget_req req; |
637 | 637 | ||
638 | memset(&req, 0, sizeof(struct ubifs_budget_req)); | 638 | memset(&req, 0, sizeof(struct ubifs_budget_req)); |
639 | /* The "no space" flags will be cleared because dd_growth is > 0 */ | ||
639 | req.dd_growth = c->inode_budget + ALIGN(ui->data_len, 8); | 640 | req.dd_growth = c->inode_budget + ALIGN(ui->data_len, 8); |
640 | ubifs_release_budget(c, &req); | 641 | ubifs_release_budget(c, &req); |
641 | } | 642 | } |