time to avoid placing them on a single disk, which can hurt the performanace.
It may also be used by block allocator.
.TP
-.BI stripe-width= stripe-width
+.BI stripe_width= stripe-width
Configure the filesystem for a RAID array with
.I stripe-width
filesystem blocks per stripe. This is typically be stride-size * N, where
This allows the block allocator to prevent read-modify-write of the
parity in a RAID stripe if possible when the data is written.
.TP
+.BI hash_alg= hash-alg
+Set the default hash algorithm used for filesystems with hashed b-tree
+directories. Valid algorithms accepted are:
+.IR legacy ,
+.IR half_md4 ,
+and
+.IR tea .
+.TP
.B test_fs
Set a flag in the filesystem superblock indicating that it may be
mounted using experimental kernel code, such as the ext4dev filesystem.
static void parse_extended_opts(ext2_filsys fs, const char *opts)
{
char *buf, *token, *next, *p, *arg;
- int len;
+ int len, hash_alg;
int r_usage = 0;
len = strlen(opts);
continue;
}
stripe_width_set = 1;
+ } else if (strcmp(token, "hash_alg") == 0 ||
+ strcmp(token, "hash-alg") == 0) {
+ if (!arg) {
+ r_usage++;
+ continue;
+ }
+ hash_alg = e2p_string2hash(arg);
+ if (hash_alg < 0) {
+ fprintf(stderr,
+ _("Invalid hash algorithm: %s\n"),
+ arg);
+ r_usage++;
+ continue;
+ }
+ fs->super->s_def_hash_version = hash_alg;
+ printf(_("Setting default hash algorithm "
+ "to %s (%d)\n"),
+ arg, hash_alg);
+ ext2fs_mark_super_dirty(fs);
} else
r_usage++;
}
"\tis set off by an equals ('=') sign.\n\n"
"Valid extended options are:\n"
"\tstride=<RAID per-disk chunk size in blocks>\n"
- "\tstripe-width=<RAID stride*data disks in blocks>\n"
+ "\tstripe_width=<RAID stride*data disks in blocks>\n"
+ "\thash_alg=<hash algorithm>\n"
"\ttest_fs\n"
"\t^test_fs\n"));
free(buf);