From: Andreas Dilger Date: Mon, 23 Jun 2025 05:56:24 +0000 (-0600) Subject: LU-10026 utils: reserve fields for compress find X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=98e2d3230ef02ea41f7999cfe395bb68e69976f1;p=fs%2Flustre-release.git LU-10026 utils: reserve fields for compress find Reserve fields for "lfs find" compressed file handling. Fill holes in struct find_param with fp_unused members so that they can be found more easily in the future. Test-Parameters: trivial Whamcloud-bug-id: EX-6856 Signed-off-by: Andreas Dilger Change-Id: Ic87b26a9120deb958247797512e648164b2540e5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59877 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Artem Blagodarenko Reviewed-by: Frederick Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre/lustreapi.h b/lustre/include/lustre/lustreapi.h index 62008c1..eea04d9 100644 --- a/lustre/include/lustre/lustreapi.h +++ b/lustre/include/lustre/lustreapi.h @@ -400,17 +400,20 @@ struct find_param { unsigned long long fp_comp_end_units; unsigned long long fp_mdt_count; unsigned int fp_projid; + unsigned int fp_unused_int; unsigned long long fp_blocks; unsigned long long fp_blocks_units; unsigned long fp_got_uuids:1, fp_obds_printed:1, fp_no_follow:1, - fp_hex_idx:1; + fp_hex_idx:1, + fp_unused_bits:28; unsigned int fp_depth; unsigned int fp_hash_type; unsigned int fp_time_margin; /* time margin in seconds */ __u32 fp_foreign_type; + __u32 fp_unused_u32; unsigned long long fp_ext_size; unsigned long long fp_ext_size_units; @@ -425,15 +428,40 @@ struct find_param { unsigned int fp_hash_inflags; unsigned int fp_hash_exflags; __u8 fp_thread_count; + __u8 fp_unused_byte1; + __u8 fp_unused_byte2; + __u8 fp_unused_byte3; /* Print all information (lfs find only) */ char *fp_format_printf_str; nlink_t fp_nlink; __u64 fp_attrs; __u64 fp_neg_attrs; - struct xattr_match_info *fp_xattr_match_info; - unsigned long int fp_skip_percent; + + unsigned int fp_compr_type; + unsigned int fp_compr_lvl; + unsigned int fp_compr_chunk; + + unsigned int fp_check_compr_type:1, + fp_exclude_compr_type:1, + fp_check_compr_lvl:1, + fp_exclude_compr_lvl:1, + fp_check_compr_chunk:1, + fp_exclude_compr_chunk:1, + fp_unused_bit1:1, /* Fields available to use*/ + fp_unused_bit2:1, /* once used, we must add */ + fp_unused_bit3:1, /* a separate flag field */ + fp_unused_bit4:1, /* at */ + fp_unused_bits2:22; /* the end of this struct */ + + long long fp_compr_lvl_sign:2, + fp_compr_chunk_sign:2, + fp_unused1_sign:2, /* add sperarate field */ + fp_unused_signs:50; /* once used up. */ + + unsigned char fp_skip_percent; unsigned long long fp_skip_total; unsigned long long fp_skip_count; + struct xattr_match_info *fp_xattr_match_info; struct find_work_queue *fp_queue; }; diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index a4b9ced..522fe9e 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -6183,10 +6183,10 @@ static int lfs_find(int argc, char **argv) param.fp_check_hash_flag = 1; param.fp_exclude_hash_type = !!neg_opt; break; - case 'k': - param.fp_skip_percent = strtoul(optarg, &endptr, 10); - if (param.fp_skip_percent < 0 || - param.fp_skip_percent >= 100 || + case 'k': { + unsigned long pct = strtoul(optarg, &endptr, 10); + + if (pct < 0 || pct >= 100 || (*endptr != '\0' && *endptr != '%')) { ret = -1; fprintf(stderr, @@ -6194,7 +6194,9 @@ static int lfs_find(int argc, char **argv) optarg); goto err; } + param.fp_skip_percent = pct; break; + } case 'l': param.fp_lazy = 1; break; diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index fd55190..492503a 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -4801,7 +4801,7 @@ matched: static bool find_skip_file(struct find_param *param) { if (param->fp_skip_count * 100 < - param->fp_skip_percent * param->fp_skip_total++) { + param->fp_skip_total++ * param->fp_skip_percent) { param->fp_skip_count++; return true; }