X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmdd%2Fmdd_orphans.c;h=e7ce0fd691b635df8e7c66622d4b3240df576396;hb=abf0e13bf261ec949ed32368296388df73c6ca72;hp=442452c1f13e9754e13e452d0ec55f43312dca2b;hpb=b69b7de30c3977cb69a741099218bc4a81752717;p=fs%2Flustre-release.git diff --git a/lustre/mdd/mdd_orphans.c b/lustre/mdd/mdd_orphans.c index 442452c..e7ce0fd 100644 --- a/lustre/mdd/mdd_orphans.c +++ b/lustre/mdd/mdd_orphans.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2013, Intel Corporation. + * Copyright (c) 2011, 2014, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -93,19 +93,17 @@ static struct dt_key* orph_key_fill_18(const struct lu_env *env, } static inline void mdd_orphan_write_lock(const struct lu_env *env, - struct mdd_device *mdd) + struct mdd_device *mdd) { - - struct dt_object *dor = mdd->mdd_orphans; - dor->do_ops->do_write_lock(env, dor, MOR_TGT_ORPHAN); + struct dt_object *dor = mdd->mdd_orphans; + dt_write_lock(env, dor, MOR_TGT_ORPHAN); } static inline void mdd_orphan_write_unlock(const struct lu_env *env, - struct mdd_device *mdd) + struct mdd_device *mdd) { - - struct dt_object *dor = mdd->mdd_orphans; - dor->do_ops->do_write_unlock(env, dor); + struct dt_object *dor = mdd->mdd_orphans; + dt_write_unlock(env, dor); } static inline int mdd_orphan_insert_obj(const struct lu_env *env, @@ -121,9 +119,7 @@ static inline int mdd_orphan_insert_obj(const struct lu_env *env, rec->rec_fid = lf; rec->rec_type = mdd_object_type(obj); - return dor->do_index_ops->dio_insert(env, dor, - (const struct dt_rec *)rec, - key, th, BYPASS_CAPA, 1); + return dt_insert(env, dor, (const struct dt_rec *)rec, key, th, 1); } static inline int mdd_orphan_delete_obj(const struct lu_env *env, @@ -131,27 +127,25 @@ static inline int mdd_orphan_delete_obj(const struct lu_env *env, struct dt_key *key, struct thandle *th) { - struct dt_object *dor = mdd->mdd_orphans; + struct dt_object *dor = mdd->mdd_orphans; - return dor->do_index_ops->dio_delete(env, dor, - key, th, - BYPASS_CAPA); + return dt_delete(env, dor, key, th); } -static inline void mdd_orphan_ref_add(const struct lu_env *env, - struct mdd_device *mdd, - struct thandle *th) +static inline int mdd_orphan_ref_add(const struct lu_env *env, + struct mdd_device *mdd, + struct thandle *th) { - struct dt_object *dor = mdd->mdd_orphans; - dor->do_ops->do_ref_add(env, dor, th); + struct dt_object *dor = mdd->mdd_orphans; + return dt_ref_add(env, dor, th); } -static inline void mdd_orphan_ref_del(const struct lu_env *env, - struct mdd_device *mdd, - struct thandle *th) +static inline int mdd_orphan_ref_del(const struct lu_env *env, + struct mdd_device *mdd, + struct thandle *th) { - struct dt_object *dor = mdd->mdd_orphans; - dor->do_ops->do_ref_del(env, dor, th); + struct dt_object *dor = mdd->mdd_orphans; + return dt_ref_del(env, dor, th); } @@ -231,15 +225,13 @@ static int orph_index_insert(const struct lu_env *env, * from here */ if (!dt_try_as_dir(env, next)) GOTO(out, rc = 0); - next->do_index_ops->dio_delete(env, next, - (const struct dt_key *)dotdot, - th, BYPASS_CAPA); + + dt_delete(env, next, (const struct dt_key *)dotdot, th); rec->rec_fid = lf_dor; rec->rec_type = S_IFDIR; - next->do_index_ops->dio_insert(env, next, (const struct dt_rec *)rec, - (const struct dt_key *)dotdot, - th, BYPASS_CAPA, 1); + dt_insert(env, next, (const struct dt_rec *)rec, + (const struct dt_key *)dotdot, th, 1); out: if (rc == 0) @@ -447,7 +439,7 @@ static int orph_index_iterate(const struct lu_env *env, ENTRY; iops = &dor->do_index_ops->dio_it; - it = iops->init(env, dor, LUDA_64BITHASH, BYPASS_CAPA); + it = iops->init(env, dor, LUDA_64BITHASH); if (IS_ERR(it)) { rc = PTR_ERR(it); CERROR("%s: cannot clean PENDING: rc = %d\n",