X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdd%2Fmdd_orphans.c;h=594b3ae598140e0ea491b218765fc3e0af380bd6;hp=e7ce0fd691b635df8e7c66622d4b3240df576396;hb=e1ace3751f9add26b3f01aad9c278b6bfca8f739;hpb=48d24ebd6d51873a6c560000ea3b638fdae22a27 diff --git a/lustre/mdd/mdd_orphans.c b/lustre/mdd/mdd_orphans.c index e7ce0fd..594b3ae 100644 --- a/lustre/mdd/mdd_orphans.c +++ b/lustre/mdd/mdd_orphans.c @@ -318,13 +318,13 @@ static int orph_index_delete(const struct lu_env *env, static int orphan_object_destroy(const struct lu_env *env, - struct mdd_object *obj, - struct dt_key *key) + struct mdd_object *obj, + struct dt_key *key) { - struct thandle *th = NULL; - struct mdd_device *mdd = mdo2mdd(&obj->mod_obj); - int rc = 0; - ENTRY; + struct thandle *th = NULL; + struct mdd_device *mdd = mdo2mdd(&obj->mod_obj); + int rc = 0; + ENTRY; th = mdd_trans_create(env, mdd); if (IS_ERR(th)) { @@ -332,22 +332,22 @@ static int orphan_object_destroy(const struct lu_env *env, RETURN(PTR_ERR(th)); } - rc = orph_declare_index_delete(env, obj, th); - if (rc) - GOTO(stop, rc); + rc = orph_declare_index_delete(env, obj, th); + if (rc) + GOTO(stop, rc); rc = mdo_declare_destroy(env, obj, th); - if (rc) - GOTO(stop, rc); + if (rc) + GOTO(stop, rc); - rc = mdd_trans_start(env, mdd, th); - if (rc) - GOTO(stop, rc); + rc = mdd_trans_start(env, mdd, th); + if (rc) + GOTO(stop, rc); - mdd_write_lock(env, obj, MOR_TGT_CHILD); - if (likely(obj->mod_count == 0)) { - mdd_orphan_write_lock(env, mdd); - rc = mdd_orphan_delete_obj(env, mdd, key, th); + mdd_write_lock(env, obj, MOR_TGT_CHILD); + if (likely(obj->mod_count == 0)) { + mdd_orphan_write_lock(env, mdd); + rc = mdd_orphan_delete_obj(env, mdd, key, th); if (rc == 0) { mdo_ref_del(env, obj, th); if (S_ISDIR(mdd_object_type(obj))) { @@ -356,15 +356,15 @@ static int orphan_object_destroy(const struct lu_env *env, } rc = mdo_destroy(env, obj, th); } else - CERROR("could not delete object: rc = %d\n",rc); - mdd_orphan_write_unlock(env, mdd); - } - mdd_write_unlock(env, obj); + CERROR("could not delete object: rc = %d\n", rc); + mdd_orphan_write_unlock(env, mdd); + } + mdd_write_unlock(env, obj); stop: - mdd_trans_stop(env, mdd, 0, th); + rc = mdd_trans_stop(env, mdd, 0, th); - RETURN(rc); + RETURN(rc); } /**