if (rc != 0)
GOTO(stop, rc);
- if (!dt_try_as_dir(env, child))
+ if (!dt_try_as_dir(env, child, false))
GOTO(stop, rc = -ENOTDIR);
/* 2a. increase child nlink */
if (rc != 0)
GOTO(stop, rc);
- if (!dt_try_as_dir(env, child))
+ if (!dt_try_as_dir(env, child, false))
GOTO(stop, rc = -ENOTDIR);
/* 2a. increase child nlink */
if (IS_ERR(child))
GOTO(unlock, rc = PTR_ERR(child));
- if (dt_object_exists(child) != 0) {
- if (unlikely(!dt_try_as_dir(env, child)))
+ if (dt_object_exists(child)) {
+ if (unlikely(!dt_try_as_dir(env, child, true)))
rc = -ENOTDIR;
else
lfsck->li_lpf_obj = child;
if (IS_ERR(parent2))
GOTO(linkea, parent2);
- if (!dt_object_exists(parent2)) {
- lfsck_object_put(env, parent2);
-
- GOTO(linkea, parent2 = ERR_PTR(-ENOENT));
- }
-
- if (!dt_try_as_dir(env, parent2)) {
+ if (!dt_try_as_dir(env, parent2, true)) {
lfsck_object_put(env, parent2);
GOTO(linkea, parent2 = ERR_PTR(-ENOTDIR));
LASSERT(dt_object_exists(parent));
- if (unlikely(!dt_try_as_dir(env, parent))) {
+ if (unlikely(!dt_try_as_dir(env, parent, true))) {
lfsck_object_put(env, parent);
GOTO(put, rc = -ENOTDIR);
goto find_child1;
}
- if (unlikely(!dt_try_as_dir(env, child2)))
+ if (unlikely(!dt_try_as_dir(env, child2, true)))
GOTO(put, rc = -ENOTDIR);
find_child1:
goto check_child2;
}
- if (unlikely(!dt_try_as_dir(env, child1))) {
+ if (unlikely(!dt_try_as_dir(env, child1, true))) {
lfsck_object_put(env, child1);
child1 = NULL;
rc = -ENOTDIR;
put:
if (lfsck->li_lpf_obj != NULL) {
- if (unlikely(!dt_try_as_dir(env, lfsck->li_lpf_obj))) {
+ if (unlikely(!dt_try_as_dir(env, lfsck->li_lpf_obj, true))) {
lfsck_object_put(env, lfsck->li_lpf_obj);
lfsck->li_lpf_obj = NULL;
rc = -ENOTDIR;
return ERR_PTR(-ENOENT);
}
- if (lso->lso_is_dir && unlikely(!dt_try_as_dir(env, obj))) {
+ if (lso->lso_is_dir && unlikely(!dt_try_as_dir(env, obj, true))) {
lfsck_object_put(env, obj);
return ERR_PTR(-ENOTDIR);
if (rc != 0)
GOTO(out, rc);
- if (unlikely(!dt_try_as_dir(env, obj)))
- GOTO(out, rc = -ENOTDIR);
-
*pfid = *fid;
rc = dt_lookup_dir(env, obj, lostfound, fid);
if (rc != 0)