+@@ -703,7 +710,7 @@ enum {
+ Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
+ Opt_grpquota,
+ Opt_extents, Opt_noextents, Opt_extdebug,
+- Opt_mballoc, Opt_nomballoc, Opt_stripe,
++ Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize
+ };
+
+ static match_table_t tokens = {
+@@ -762,8 +769,9 @@ static match_table_t tokens = {
+ {Opt_mballoc, "mballoc"},
+ {Opt_nomballoc, "nomballoc"},
+ {Opt_stripe, "stripe=%u"},
+- {Opt_err, NULL},
+ {Opt_resize, "resize"},
++ {Opt_maxdirsize, "maxdirsize=%u"},
++ {Opt_err, NULL}
+ };
+
+ static ext3_fsblk_t get_sb_block(void **data)
+@@ -1128,6 +1136,13 @@ clear_qf_name:
+ return 0;
+ sbi->s_stripe = option;
+ break;
++ case Opt_maxdirsize:
++ if (match_int(&args[0], &option))
++ return 0;
++ if (option <= 0)
++ return 0;
++ sbi->s_max_dir_size = option;
++ break;
+ default:
+ printk (KERN_ERR
+ "EXT3-fs: Unrecognized mount option \"%s\" "
+@@ -1875,6 +1890,45 @@ failed: