|
@@ -96,6 +96,7 @@ struct mount_options
|
|
|
signed short slot;
|
|
|
int localalloc_opt;
|
|
|
unsigned int resv_level;
|
|
|
+ int dir_resv_level;
|
|
|
char cluster_stack[OCFS2_STACK_LABEL_LEN + 1];
|
|
|
};
|
|
|
|
|
@@ -178,6 +179,7 @@ enum {
|
|
|
Opt_usrquota,
|
|
|
Opt_grpquota,
|
|
|
Opt_resv_level,
|
|
|
+ Opt_dir_resv_level,
|
|
|
Opt_err,
|
|
|
};
|
|
|
|
|
@@ -205,6 +207,7 @@ static const match_table_t tokens = {
|
|
|
{Opt_usrquota, "usrquota"},
|
|
|
{Opt_grpquota, "grpquota"},
|
|
|
{Opt_resv_level, "resv_level=%u"},
|
|
|
+ {Opt_dir_resv_level, "dir_resv_level=%u"},
|
|
|
{Opt_err, NULL}
|
|
|
};
|
|
|
|
|
@@ -1034,6 +1037,11 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
|
|
|
|
|
|
ocfs2_la_set_sizes(osb, parsed_options.localalloc_opt);
|
|
|
osb->osb_resv_level = parsed_options.resv_level;
|
|
|
+ osb->osb_dir_resv_level = parsed_options.resv_level;
|
|
|
+ if (parsed_options.dir_resv_level == -1)
|
|
|
+ osb->osb_dir_resv_level = parsed_options.resv_level;
|
|
|
+ else
|
|
|
+ osb->osb_dir_resv_level = parsed_options.dir_resv_level;
|
|
|
|
|
|
status = ocfs2_verify_userspace_stack(osb, &parsed_options);
|
|
|
if (status)
|
|
@@ -1295,6 +1303,7 @@ static int ocfs2_parse_options(struct super_block *sb,
|
|
|
mopt->localalloc_opt = -1;
|
|
|
mopt->cluster_stack[0] = '\0';
|
|
|
mopt->resv_level = OCFS2_DEFAULT_RESV_LEVEL;
|
|
|
+ mopt->dir_resv_level = -1;
|
|
|
|
|
|
if (!options) {
|
|
|
status = 1;
|
|
@@ -1449,6 +1458,17 @@ static int ocfs2_parse_options(struct super_block *sb,
|
|
|
option < OCFS2_MAX_RESV_LEVEL)
|
|
|
mopt->resv_level = option;
|
|
|
break;
|
|
|
+ case Opt_dir_resv_level:
|
|
|
+ if (is_remount)
|
|
|
+ break;
|
|
|
+ if (match_int(&args[0], &option)) {
|
|
|
+ status = 0;
|
|
|
+ goto bail;
|
|
|
+ }
|
|
|
+ if (option >= OCFS2_MIN_RESV_LEVEL &&
|
|
|
+ option < OCFS2_MAX_RESV_LEVEL)
|
|
|
+ mopt->dir_resv_level = option;
|
|
|
+ break;
|
|
|
default:
|
|
|
mlog(ML_ERROR,
|
|
|
"Unrecognized mount option \"%s\" "
|
|
@@ -1533,6 +1553,9 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
|
|
|
if (osb->osb_resv_level != OCFS2_DEFAULT_RESV_LEVEL)
|
|
|
seq_printf(s, ",resv_level=%d", osb->osb_resv_level);
|
|
|
|
|
|
+ if (osb->osb_dir_resv_level != osb->osb_resv_level)
|
|
|
+ seq_printf(s, ",dir_resv_level=%d", osb->osb_resv_level);
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|