if (unlikely(lfsck_is_dead_obj(obj)))
RETURN(LFSCK_NAMEENTRY_DEAD);
- rc = dt_lookup(env, dir, (struct dt_rec *)fid,
- (const struct dt_key *)name);
+ rc = dt_lookup_dir(env, dir, name, fid);
if (rc == -ENOENT)
RETURN(LFSCK_NAMEENTRY_REMOVED);
do {
namelen = snprintf(info->lti_key, NAME_MAX, DFID"%s-%s-%d",
PFID(cfid), infix, type, idx++);
- rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
- (const struct dt_key *)info->lti_key);
+ rc = dt_lookup_dir(env, parent, info->lti_key, &tfid);
if (rc != 0 && rc != -ENOENT)
GOTO(log, rc);
/* Re-check whether the name conflict with othrs after taken
* the ldlm lock. */
- rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
- (const struct dt_key *)info->lti_key);
+ rc = dt_lookup_dir(env, parent, info->lti_key, &tfid);
if (rc == 0) {
if (!lu_fid_eq(cfid, &tfid)) {
exist = false;
GOTO(log, rc = idx);
snprintf(name, 8, "MDT%04x", idx);
- rc = dt_lookup(env, lfsck->li_lpf_root_obj,
- (struct dt_rec *)&tfid,
- (const struct dt_key *)name);
+ rc = dt_lookup_dir(env, lfsck->li_lpf_root_obj, name, &tfid);
if (rc != 0)
GOTO(log, rc = (rc == -ENOENT ? -ENXIO : rc));
do {
namelen = snprintf(name, 31, DFID"-P-%d",
PFID(cfid), idx++);
- rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
- (const struct dt_key *)name);
+ rc = dt_lookup_dir(env, parent, name, &tfid);
if (rc != 0 && rc != -ENOENT)
GOTO(log, rc);
} while (rc == 0);
/* Re-check whether the name conflict with othrs after taken
* the ldlm lock. */
- rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
- (const struct dt_key *)name);
+ rc = dt_lookup_dir(env, parent, name, &tfid);
if (unlikely(rc == 0)) {
lfsck_unlock(llh);
goto again;
goto replace;
}
- rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
- (const struct dt_key *)name);
+ rc = dt_lookup_dir(env, parent, name, &tfid);
if (rc == -ENOENT) {
exist = false;
goto replace;
dt_write_lock(env, parent, 0);
- rc = dt_lookup(env, dt_object_child(parent), (struct dt_rec *)&tfid,
- (const struct dt_key *)name);
+ rc = dt_lookup_dir(env, dt_object_child(parent), name, &tfid);
/* Someone has removed the bad name entry by race. */
if (rc == -ENOENT)
GOTO(unlock2, rc = 0);
GOTO(out, rc);
}
- rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
- (const struct dt_key *)cname->ln_name);
+ rc = dt_lookup_dir(env, parent, cname->ln_name, &tfid);
if (rc == -ENOENT) {
/* If the LFSCK is marked as LF_INCOMPLETE, then means some MDT
* has ever tried to verify some remote MDT-object that resides
continue;
}
- rc = dt_lookup(env, parent, (struct dt_rec *)&tfid,
- (const struct dt_key *)cname->ln_name);
+ rc = dt_lookup_dir(env, parent, cname->ln_name, &tfid);
*pfid2 = *lfsck_dto2fid(parent);
if (rc == -ENOENT) {
lfsck_object_put(env, parent);
GOTO(out, rc = 0);
}
- rc = dt_lookup(env, child, (struct dt_rec *)pfid,
- (const struct dt_key *)dotdot);
+ rc = dt_lookup_dir(env, child, dotdot, pfid);
if (rc != 0) {
if (rc != -ENOENT && rc != -ENODATA && rc != -EINVAL) {
dt_read_unlock(env, child);
continue;
}
- rc = dt_lookup(env, parent, (struct dt_rec *)cfid,
- (const struct dt_key *)cname->ln_name);
+ rc = dt_lookup_dir(env, parent, cname->ln_name, cfid);
if (rc != 0 && rc != -ENOENT) {
lfsck_object_put(env, parent);