mke2fs.c (main): Enable directory indexing by default.
tune2fs.c (update_feature_set): Allow directory indexing flag to
be set. If so, set the default hash to be TEA, and
initialize the hash seed to a random value.
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 0f5f1e0..c37eecc 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -777,7 +777,8 @@
}
static __u32 ok_features[3] = {
- EXT3_FEATURE_COMPAT_HAS_JOURNAL, /* Compat */
+ EXT3_FEATURE_COMPAT_HAS_JOURNAL |
+ EXT2_FEATURE_COMPAT_DIR_INDEX, /* Compat */
EXT2_FEATURE_INCOMPAT_FILETYPE| /* Incompat */
EXT3_FEATURE_INCOMPAT_JOURNAL_DEV,
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER /* R/O compat */
@@ -841,7 +842,8 @@
param.s_rev_level = 1; /* Create revision 1 filesystems now */
param.s_feature_incompat |= EXT2_FEATURE_INCOMPAT_FILETYPE;
param.s_feature_ro_compat |= EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
-
+ param.s_feature_compat |= EXT2_FEATURE_COMPAT_DIR_INDEX;
+
#ifdef __linux__
if (uname(&ut)) {
perror("uname");
@@ -1242,6 +1244,12 @@
uuid_generate(fs->super->s_uuid);
/*
+ * Initialize the directory index variables
+ */
+ fs->super->s_def_hash_version = EXT2_HASH_TEA;
+ uuid_generate((unsigned char *) fs->super->s_hash_seed);
+
+ /*
* Add "jitter" to the superblock's check interval so that we
* don't check all the filesystems at the same time. We use a
* kludgy hack of using the UUID to derive a random jitter value.