error "found $found compress level -$lvl file != $expect"
done
+ # test combination of compr type and compr level
+ flg_opts="--compr-type=gzip --compr-level=1"
+ found=$($LFS find $flg_opts $DIR/$tdir | wc -l)
+ (( $found == 1 )) ||
+ error "found $found compress type gzip level 1 files != 1"
+ flg_opts="--compr-type=gzip ! --compr-level=1"
+ found=$($LFS find $flg_opts $DIR/$tdir | wc -l)
+ (( $found == 0 )) ||
+ error "found $found compress type gzip ! level 1 files != 0"
+ flg_opts="--compr-type=gzip --compr-level=2"
+ found=$($LFS find $flg_opts $DIR/$tdir | wc -l)
+ (( $found == 0 )) ||
+ error "found $found compress type gzip level 2 files != 0"
+
cs="64 128 256 512"
local i=1
for chunk in $cs; do
int i, j;
bool valid = false;
bool found_type = false, found_lvl = false, found_chunk = false;
+ bool found;
unsigned long long val;
if (v1->lmm_magic != LOV_USER_MAGIC_COMP_V1)
for (i = 0; i < comp_v1->lcm_entry_count; i++) {
entry = &comp_v1->lcm_entries[i];
+ found = true;
/**
* if it's not a compress file, don't count it as a valid
}
}
- if ((param->fp_check_compr_type && found_type) ||
- (param->fp_check_compr_lvl && found_lvl) ||
- (param->fp_check_compr_chunk && found_chunk))
+ if (param->fp_check_compr_type && !found_type)
+ found = false;
+ if (param->fp_check_compr_lvl && !found_lvl)
+ found = false;
+ if (param->fp_check_compr_chunk && !found_chunk)
+ found = false;
+
+ if (found)
break;
}
if (!valid)
return -1;
+ found = true;
if (param->fp_check_compr_type &&
- ((found_type && !param->fp_exclude_compr_type) ||
- (!found_type && param->fp_exclude_compr_type)))
- return 1;
+ ((!found_type && !param->fp_exclude_compr_type) ||
+ (found_type && param->fp_exclude_compr_type)))
+ found = false;
- if (param->fp_check_compr_lvl && found_lvl)
- return 1;
+ if (param->fp_check_compr_lvl && !found_lvl)
+ found = false;
- if (param->fp_check_compr_chunk && found_chunk)
- return 1;
+ if (param->fp_check_compr_chunk && !found_chunk)
+ found = false;
- return -1;
+ return found ? 1 : -1;
}
#define LOV_PATTERN_INVALID 0xFFFFFFFF