X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Flfsck%2Flfsck_engine.c;h=f9c65b8c08cba037e19d5dcaeedc7b1782aadc45;hp=3be7606e9f66d262a8f5952cc3abd88aa915f632;hb=d525ad4bd0d5d851405e4249859a1c77378f0ee3;hpb=ee7ca785615f2da71932512d8545763836ef8197 diff --git a/lustre/lfsck/lfsck_engine.c b/lustre/lfsck/lfsck_engine.c index 3be7606..f9c65b8 100644 --- a/lustre/lfsck/lfsck_engine.c +++ b/lustre/lfsck/lfsck_engine.c @@ -93,17 +93,6 @@ static void lfsck_di_dir_put(const struct lu_env *env, struct lfsck_instance *lf iops->put(env, di); } -static int lfsck_parent_fid(const struct lu_env *env, struct dt_object *obj, - struct lu_fid *fid) -{ - if (unlikely(!S_ISDIR(lfsck_object_type(obj)) || - !dt_try_as_dir(env, obj))) - return -ENOTDIR; - - return dt_lookup(env, obj, (struct dt_rec *)fid, - (const struct dt_key *)".."); -} - /** * Check whether needs to scan the directory or not. * @@ -217,7 +206,7 @@ static int lfsck_needs_scan_dir(const struct lu_env *env, if (rc < 0 && rc != -ENODATA) GOTO(out, rc); - rc = lfsck_parent_fid(env, obj, fid); + rc = dt_lookup_dir(env, obj, dotdot, fid); if (depth > 0) lfsck_object_put(env, obj); @@ -274,7 +263,7 @@ static int lfsck_load_stripe_lmv(const struct lu_env *env, else stripes = lmv->lmv_stripe_count; - OBD_ALLOC_LARGE(lslr, sizeof(*lslr) * stripes); + OBD_ALLOC_PTR_ARRAY_LARGE(lslr, stripes); if (lslr == NULL) { OBD_FREE_PTR(llmv); @@ -1583,7 +1572,7 @@ int lfsck_assistant_engine(void *args) struct lfsck_assistant_data *lad = com->lc_data; struct ptlrpc_thread *mthread = &lfsck->li_thread; struct ptlrpc_thread *athread = &lad->lad_thread; - struct lfsck_assistant_operations *lao = lad->lad_ops; + const struct lfsck_assistant_operations *lao = lad->lad_ops; struct lfsck_assistant_req *lar; int rc = 0; int rc1 = 0;