const struct lu_fid *fid)
{
struct lu_object_conf *conf = &lfsck_env_info(env)->lti_conf;
- struct dt_object *obj;
conf->loc_flags = LOC_F_NOWAIT;
- obj = lu2dt(lu_object_find_slice(env, dt2lu_dev(dev), fid, conf));
- if (unlikely(obj == NULL))
- return ERR_PTR(-ENOENT);
-
- return obj;
+ return lu2dt(lu_object_find_slice(env, dt2lu_dev(dev), fid, conf));
}
static inline struct dt_object *
lfsck_object_find_by_dev(const struct lu_env *env, struct dt_device *dev,
const struct lu_fid *fid)
{
- struct dt_object *obj;
-
- obj = lu2dt(lu_object_find_slice(env, dt2lu_dev(dev), fid, NULL));
- if (unlikely(obj == NULL))
- return ERR_PTR(-ENOENT);
-
- return obj;
+ return lu2dt(lu_object_find_slice(env, dt2lu_dev(dev), fid, NULL));
}
static inline struct dt_object *lfsck_object_find(const struct lu_env *env,
/* Check if object with this fid exists */
child = mdd_object_find(env, mdd, f);
- if (child == NULL)
- GOTO(out, rc = 0);
if (IS_ERR(child))
GOTO(out, rc = PTR_ERR(child));
const struct lu_fid *f,
const struct lu_object_conf *conf)
{
- struct lu_object *top;
- struct lu_object *obj;
-
- top = lu_object_find(env, dev, f, conf);
- if (!IS_ERR(top)) {
- obj = lu_object_locate(top->lo_header, dev->ld_type);
- if (obj == NULL)
- lu_object_put(env, top);
- } else
- obj = top;
- return obj;
+ struct lu_object *top;
+ struct lu_object *obj;
+
+ top = lu_object_find(env, dev, f, conf);
+ if (IS_ERR(top))
+ return top;
+
+ obj = lu_object_locate(top->lo_header, dev->ld_type);
+ if (unlikely(obj == NULL)) {
+ lu_object_put(env, top);
+ obj = ERR_PTR(-ENOENT);
+ }
+
+ return obj;
}
EXPORT_SYMBOL(lu_object_find_slice);