separator = "\n";
}
- if (verbose & VERBOSE_STRIPE_SIZE) {
+ if (((verbose & VERBOSE_STRIPE_SIZE) && !extension) ||
+ ((verbose & VERBOSE_EXT_SIZE) && extension)) {
llapi_printf(LLAPI_MSG_NORMAL, "%s", separator);
- if (verbose & ~VERBOSE_STRIPE_SIZE && extension)
+ if (verbose & ~VERBOSE_EXT_SIZE && extension)
llapi_printf(LLAPI_MSG_NORMAL, "%s%sextension_size: ",
space, prefix);
- else if (verbose & ~VERBOSE_STRIPE_SIZE)
+ if (verbose & ~VERBOSE_STRIPE_SIZE && !extension)
llapi_printf(LLAPI_MSG_NORMAL, "%s%sstripe_size: ",
space, prefix);
if (is_dir && !is_raw && lum->lmm_stripe_size == 0) {
*/
if (entry->lcme_flags & LCME_FL_INIT)
continue;
- else
- break;
+
+ if (param->fp_verbose & VERBOSE_EXT_SIZE) {
+ if (entry->lcme_flags & LCME_FL_EXTENSION)
+ /* moved back below */
+ i++;
+ else
+ continue;
+ }
+ break;
}
if (entry->lcme_flags & LCME_FL_INIT) {
if (v1->lmm_magic == LOV_USER_MAGIC_FOREIGN)
return param->fp_exclude_stripe_size ? 1 : -1;
+ ret = param->fp_exclude_stripe_size ? 1 : -1;
if (v1->lmm_magic == LOV_USER_MAGIC_COMP_V1) {
comp_v1 = (struct lov_comp_md_v1 *)v1;
count = comp_v1->lcm_entry_count;
- ret = param->fp_exclude_stripe_size ? 1 : -1;
}
for (i = 0; i < count; i++) {
- if (comp_v1)
+ struct lov_comp_md_entry_v1 *ent;
+
+ if (comp_v1) {
v1 = lov_comp_entry(comp_v1, i);
+ ent = &comp_v1->lcm_entries[i];
+ if (ent->lcme_flags & LCME_FL_EXTENSION)
+ continue;
+ }
+
ret = find_value_cmp(v1->lmm_stripe_size, param->fp_stripe_size,
param->fp_stripe_size_sign,
param->fp_exclude_stripe_size,
return ret;
}
+static int find_check_ext_size(struct find_param *param)
+{
+ struct lov_comp_md_v1 *comp_v1;
+ struct lov_user_md_v1 *v1;
+ int ret, i;
+
+ ret = param->fp_exclude_ext_size ? 1 : -1;
+ comp_v1 = (struct lov_comp_md_v1 *)¶m->fp_lmd->lmd_lmm;
+ if (comp_v1->lcm_magic != LOV_USER_MAGIC_COMP_V1)
+ return ret;
+
+ for (i = 0; i < comp_v1->lcm_entry_count; i++) {
+ struct lov_comp_md_entry_v1 *ent;
+
+ v1 = lov_comp_entry(comp_v1, i);
+
+ ent = &comp_v1->lcm_entries[i];
+ if (!(ent->lcme_flags & LCME_FL_EXTENSION))
+ continue;
+
+ ret = find_value_cmp(v1->lmm_stripe_size, param->fp_ext_size,
+ param->fp_ext_size_sign,
+ param->fp_exclude_ext_size,
+ param->fp_ext_size_units, 0);
+ /* If any ext_size matches */
+ if (ret != -1)
+ break;
+ }
+
+ return ret;
+}
+
static __u32 find_get_stripe_count(struct find_param *param)
{
struct lov_comp_md_v1 *comp_v1 = NULL;
}
for (i = 0; i < count; i++) {
- if (comp_v1)
+ if (comp_v1) {
+ struct lov_comp_md_entry_v1 *ent;
+
v1 = lov_comp_entry(comp_v1, i);
+
+ ent = &comp_v1->lcm_entries[i];
+ if (ent->lcme_flags & LCME_FL_EXTENSION)
+ continue;
+ }
stripe_count += v1->lmm_stripe_count;
}
param->fp_check_comp_count || param->fp_check_comp_end ||
param->fp_check_comp_start || param->fp_check_comp_flags ||
param->fp_check_mirror_count || param->fp_check_foreign ||
- param->fp_check_mirror_state ||
+ param->fp_check_mirror_state || param->fp_check_ext_size ||
param->fp_check_projid;
}
goto decided;
}
+ if (param->fp_check_ext_size) {
+ decision = find_check_ext_size(param);
+ if (decision == -1)
+ goto decided;
+ }
+
if (param->fp_check_stripe_count) {
decision = find_value_cmp(stripe_count, param->fp_stripe_count,
param->fp_stripe_count_sign,