summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/ubifs.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-12-19 18:26:29 +0100
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-12-23 11:23:29 +0100
commitaf14a1ad792621942a03e4bd0e5f17b6e177e2e0 (patch)
treeb91e77a8a1a373ca3dfcc84ec0feb243fb74e2e5 /fs/ubifs/ubifs.h
parentUBIFS: various comment improvements and fixes (diff)
downloadlinux-af14a1ad792621942a03e4bd0e5f17b6e177e2e0.tar.xz
linux-af14a1ad792621942a03e4bd0e5f17b6e177e2e0.zip
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>
Diffstat (limited to 'fs/ubifs/ubifs.h')
-rw-r--r--fs/ubifs/ubifs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index f8ef7c1def1f..543e850022eb 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -63,6 +63,14 @@
#define SQNUM_WARN_WATERMARK 0xFFFFFFFF00000000ULL
#define SQNUM_WATERMARK 0xFFFFFFFFFF000000ULL
+/*
+ * Minimum amount of LEBs reserved for the index. 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).
+ */
+#define MIN_INDEX_LEBS 2
+
/* Minimum amount of data UBIFS writes to the flash */
#define MIN_WRITE_SZ (UBIFS_DATA_NODE_SZ + 8)