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>
这个提交包含在:
Artem Bityutskiy
2008-12-19 19:26:29 +02:00
父节点 d3cf502b6c
当前提交 af14a1ad79
修改 3 个文件,包含 13 行新增9 行删除

查看文件

@@ -280,13 +280,8 @@ int ubifs_calc_min_idx_lebs(struct ubifs_info *c)
* extra LEB to compensate.
*/
ret += 1;
/*
* At present the index needs at least 2 LEBs: one for the index head
* and one for in-the-gaps method (which currently does not cater for
* the index head and so excludes it from consideration).
*/
if (ret < 2)
ret = 2;
if (ret < MIN_INDEX_LEBS)
ret = MIN_INDEX_LEBS;
return ret;
}