UBIFS: fix budgeting calculations

The 'ubifs_release_dirty_inode_budget()' was buggy and incorrectly
freed the budget, which led to not freeing all dirty data budget.
This patch fixes that.

Also, this patch fixes ubifs_mkdir() which passed 1 in dirty_ino_d,
which makes no sense. Well, it is harmless though.

Also, add few more useful assertions. And improve few debugging
messages.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
此提交包含在:
Artem Bityutskiy
2008-07-18 18:54:29 +03:00
父節點 ce769caa50
當前提交 182854b46f
共有 2 個檔案被更改,包括 4 行新增4 行删除

查看文件

@@ -686,9 +686,10 @@ void ubifs_convert_page_budget(struct ubifs_info *c)
void ubifs_release_dirty_inode_budget(struct ubifs_info *c,
struct ubifs_inode *ui)
{
struct ubifs_budget_req req = {.dd_growth = c->inode_budget,
.dirtied_ino_d = ui->data_len};
struct ubifs_budget_req req;
memset(&req, 0, sizeof(struct ubifs_budget_req));
req.dd_growth = c->inode_budget + ui->data_len;
ubifs_release_budget(c, &req);
}