strcat(path, dent->d_name);
if (dent->d_type == DT_UNKNOWN) {
- lstatx_t *stx = ¶m->fp_lmd->lmd_stx;
+ struct lov_user_mds_data *lmd = param->fp_lmd;
- rc = get_lmd_info(path, d, NULL, param->fp_lmd,
+ rc = get_lmd_info(path, d, NULL, lmd,
param->fp_lum_size, GET_LMD_INFO);
if (rc == 0)
- dent->d_type = IFTODT(stx->stx_mode);
+ dent->d_type = IFTODT(lmd->lmd_stx.stx_mode);
else if (ret == 0)
ret = rc;
*
* If 0 is returned, we need to do another RPC to the OSTs to obtain the
* updated timestamps. */
-static int find_time_check(lstatx_t *stx, struct find_param *param, int mds)
+static int find_time_check(struct find_param *param, int mds)
{
+ struct lov_user_mds_data *lmd = param->fp_lmd;
int rc = 1;
int rc2;
/* Check if file is accepted. */
if (param->fp_atime) {
- rc2 = find_value_cmp(stx->stx_atime.tv_sec, param->fp_atime,
- param->fp_asign, param->fp_exclude_atime,
+ rc2 = find_value_cmp(lmd->lmd_stx.stx_atime.tv_sec,
+ param->fp_atime, param->fp_asign,
+ param->fp_exclude_atime,
param->fp_time_margin, mds);
if (rc2 < 0)
return rc2;
}
if (param->fp_mtime) {
- rc2 = find_value_cmp(stx->stx_mtime.tv_sec, param->fp_mtime,
- param->fp_msign, param->fp_exclude_mtime,
+ rc2 = find_value_cmp(lmd->lmd_stx.stx_mtime.tv_sec,
+ param->fp_mtime, param->fp_msign,
+ param->fp_exclude_mtime,
param->fp_time_margin, mds);
if (rc2 < 0)
return rc2;
}
if (param->fp_ctime) {
- rc2 = find_value_cmp(stx->stx_ctime.tv_sec, param->fp_ctime,
- param->fp_csign, param->fp_exclude_ctime,
+ rc2 = find_value_cmp(lmd->lmd_stx.stx_ctime.tv_sec,
+ param->fp_ctime, param->fp_csign,
+ param->fp_exclude_ctime,
param->fp_time_margin, mds);
if (rc2 < 0)
return rc2;
return rc;
}
-static int find_newerxy_check(lstatx_t *stx, struct find_param *param, int mds)
+static int find_newerxy_check(struct find_param *param, int mds)
{
+ struct lov_user_mds_data *lmd = param->fp_lmd;
int i;
int rc = 1;
int rc2;
for (i = 0; i < 2; i++) {
/* Check if file is accepted. */
if (param->fp_newery[NEWERXY_ATIME][i]) {
- rc2 = find_value_cmp(stx->stx_atime.tv_sec,
+ rc2 = find_value_cmp(lmd->lmd_stx.stx_atime.tv_sec,
param->fp_newery[NEWERXY_ATIME][i],
-1, i, 0, mds);
if (rc2 < 0)
}
if (param->fp_newery[NEWERXY_MTIME][i]) {
- rc2 = find_value_cmp(stx->stx_mtime.tv_sec,
+ rc2 = find_value_cmp(lmd->lmd_stx.stx_mtime.tv_sec,
param->fp_newery[NEWERXY_MTIME][i],
-1, i, 0, mds);
if (rc2 < 0)
}
if (param->fp_newery[NEWERXY_CTIME][i]) {
- rc2 = find_value_cmp(stx->stx_ctime.tv_sec,
+ rc2 = find_value_cmp(lmd->lmd_stx.stx_ctime.tv_sec,
param->fp_newery[NEWERXY_CTIME][i],
-1, i, 0, mds);
if (rc2 < 0)
{
struct lov_user_ost_data_v1 *objects;
struct lov_comp_md_v1 *comp_v1 = NULL;
- struct lov_user_md_v1 *v1 = ¶m->fp_lmd->lmd_lmm;
- lstatx_t *stx = ¶m->fp_lmd->lmd_stx;
+ struct lov_user_mds_data *lmd = param->fp_lmd;
+ struct lov_user_md_v1 *v1 = &lmd->lmd_lmm;
int i, j, k, count = 1;
if (param->fp_obd_uuid && param->fp_obd_index == OBD_NOT_FOUND)
return 0;
- if (!S_ISREG(stx->stx_mode))
+ if (!S_ISREG(lmd->lmd_stx.stx_mode))
return 0;
/* exclude foreign */
static int find_check_comp_options(struct find_param *param)
{
- lstatx_t *stx = ¶m->fp_lmd->lmd_stx;
struct lov_comp_md_v1 *comp_v1, *forged_v1 = NULL;
- struct lov_user_md_v1 *v1 = ¶m->fp_lmd->lmd_lmm;
+ struct lov_user_mds_data *lmd = param->fp_lmd;
+ struct lov_user_md_v1 *v1 = &lmd->lmd_lmm;
struct lov_comp_md_entry_v1 *entry;
int i, ret = 0;
comp_v1 = forged_v1;
comp_v1->lcm_entry_count = 1;
entry = &comp_v1->lcm_entries[0];
- entry->lcme_flags = S_ISDIR(stx->stx_mode) ? 0 : LCME_FL_INIT;
+ entry->lcme_flags = S_ISDIR(lmd->lmd_stx.stx_mode) ?
+ 0 : LCME_FL_INIT;
entry->lcme_extent.e_start = 0;
entry->lcme_extent.e_end = LUSTRE_EOF;
}
void *data, struct dirent64 *de)
{
struct find_param *param = (struct find_param *)data;
+ struct lov_user_mds_data *lmd = param->fp_lmd;
DIR *dir = dirp == NULL ? NULL : *dirp;
int decision = 1; /* 1 is accepted; -1 is rejected. */
- lstatx_t *stx = ¶m->fp_lmd->lmd_stx;
int lustre_fs = 1;
int checked_type = 0;
int ret = 0;
if (dir != NULL) {
ret = llapi_file_fget_mdtidx(dirfd(dir),
¶m->fp_file_mdt_index);
- } else if (S_ISREG(stx->stx_mode)) {
+ } else if (S_ISREG(lmd->lmd_stx.stx_mode)) {
/* FIXME: we could get the MDT index from the
* file's FID in lmd->lmd_lmm.lmm_oi without
* opening the file, once we are sure that
}
if (param->fp_type && !checked_type) {
- if ((stx->stx_mode & S_IFMT) == param->fp_type) {
+ if ((lmd->lmd_stx.stx_mode & S_IFMT) == param->fp_type) {
if (param->fp_exclude_type)
goto decided;
} else {
/* Prepare odb. */
if (param->fp_obd_uuid || param->fp_mdt_uuid) {
if (lustre_fs && param->fp_got_uuids &&
- param->fp_dev != makedev(stx->stx_dev_major,
- stx->stx_dev_minor)) {
+ param->fp_dev != makedev(lmd->lmd_stx.stx_dev_major,
+ lmd->lmd_stx.stx_dev_minor)) {
/* A lustre/lustre mount point is crossed. */
param->fp_got_uuids = 0;
param->fp_obds_printed = 0;
if (ret)
goto out;
- param->fp_dev = makedev(stx->stx_dev_major,
- stx->stx_dev_minor);
+ param->fp_dev = makedev(lmd->lmd_stx.stx_dev_major,
+ lmd->lmd_stx.stx_dev_minor);
} else if (!lustre_fs && param->fp_got_uuids) {
/* A lustre/non-lustre mount point is crossed. */
param->fp_got_uuids = 0;
obd_matches:
if (param->fp_check_uid) {
- if (stx->stx_uid == param->fp_uid) {
+ if (lmd->lmd_stx.stx_uid == param->fp_uid) {
if (param->fp_exclude_uid)
goto decided;
} else {
}
if (param->fp_check_gid) {
- if (stx->stx_gid == param->fp_gid) {
+ if (lmd->lmd_stx.stx_gid == param->fp_gid) {
if (param->fp_exclude_gid)
goto decided;
} else {
int for_mds;
for_mds = lustre_fs ?
- (S_ISREG(stx->stx_mode) && stripe_count) : 0;
- decision = find_time_check(stx, param, for_mds);
+ (S_ISREG(lmd->lmd_stx.stx_mode) && stripe_count) : 0;
+ decision = find_time_check(param, for_mds);
if (decision == -1)
goto decided;
}
int for_mds;
for_mds = lustre_fs ?
- (S_ISREG(stx->stx_mode) && stripe_count) : 0;
- decision = find_newerxy_check(stx, param, for_mds);
+ (S_ISREG(lmd->lmd_stx.stx_mode) && stripe_count) : 0;
+ decision = find_newerxy_check(param, for_mds);
if (decision == -1)
goto decided;
}
flags = param->fp_lmd->lmd_flags;
if (param->fp_check_size &&
- ((S_ISREG(stx->stx_mode) && stripe_count) ||
- S_ISDIR(stx->stx_mode)) &&
+ ((S_ISREG(lmd->lmd_stx.stx_mode) && stripe_count) ||
+ S_ISDIR(lmd->lmd_stx.stx_mode)) &&
!(flags & OBD_MD_FLSIZE ||
(param->fp_lazy && flags & OBD_MD_FLLAZYSIZE)))
decision = 0;
if (param->fp_check_blocks &&
- ((S_ISREG(stx->stx_mode) && stripe_count) ||
- S_ISDIR(stx->stx_mode)) &&
+ ((S_ISREG(lmd->lmd_stx.stx_mode) && stripe_count) ||
+ S_ISDIR(lmd->lmd_stx.stx_mode)) &&
!(flags & OBD_MD_FLBLOCKS ||
(param->fp_lazy && flags & OBD_MD_FLLAZYBLOCKS)))
decision = 0;
convert_lmd_statx(param->fp_lmd, &st, true);
/* Check the time on osc. */
- decision = find_time_check(stx, param, 0);
+ decision = find_time_check(param, 0);
if (decision == -1)
goto decided;
if (param->fp_newerxy) {
- decision = find_newerxy_check(stx, param, 0);
+ decision = find_newerxy_check(param, 0);
if (decision == -1)
goto decided;
}
if (param->fp_check_size) {
- decision = find_value_cmp(stx->stx_size, param->fp_size,
+ decision = find_value_cmp(lmd->lmd_stx.stx_size,
+ param->fp_size,
param->fp_size_sign,
param->fp_exclude_size,
param->fp_size_units, 0);
}
if (param->fp_check_blocks) { /* convert st_blocks to bytes */
- decision = find_value_cmp(stx->stx_blocks * 512,
+ decision = find_value_cmp(lmd->lmd_stx.stx_blocks * 512,
param->fp_blocks,
param->fp_blocks_sign,
param->fp_exclude_blocks,