summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/find.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-07-25 14:38:51 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-08-13 11:37:28 +0300
commitb364b41aeb0289be402be83eebca92eb90bfcb8b (patch)
tree8bec0a45617f30e24b112b66973ac3eac72da834 /fs/ubifs/find.c
parent1de9415906bccab51fb74c6adf575948610f0909 (diff)
downloadlinux-b364b41aeb0289be402be83eebca92eb90bfcb8b.tar.bz2
UBIFS: reserve more space for index
At the moment UBIFS reserves twice old index size space for the index. But this is not enough in some cases, because if the indexing node are very fragmented and there are many small gaps, while the dirty index has big znodes - in-the-gaps method would fail. Thus, reserve trise as more, in which case we are guaranteed that we can commit in any case. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/find.c')
-rw-r--r--fs/ubifs/find.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c
index 10394c548367..c70c7679c1bf 100644
--- a/fs/ubifs/find.c
+++ b/fs/ubifs/find.c
@@ -290,9 +290,14 @@ int ubifs_find_dirty_leb(struct ubifs_info *c, struct ubifs_lprops *ret_lp,
idx_lp = idx_heap->arr[0];
sum = idx_lp->free + idx_lp->dirty;
/*
- * Since we reserve twice as more space for the index than it
+ * Since we reserve trice as more space for the index than it
* actually takes, it does not make sense to pick indexing LEBs
- * with less than half LEB of dirty space.
+ * with less than, say, half LEB of dirty space. May be half is
+ * not the optimal boundary - this should be tested and
+ * checked. This boundary should determine how much we use
+ * in-the-gaps to consolidate the index comparing to how much
+ * we use garbage collector to consolidate it. The "half"
+ * criteria just feels to be fine.
*/
if (sum < min_space || sum < c->half_leb_size)
idx_lp = NULL;