Whamcloud - gitweb
LU-3815 tests: sanity-hsm - Remove tests from Always_Except
[fs/lustre-release.git] / lustre / mdd / mdd_orphans.c
index ee398cf..594b3ae 100644 (file)
@@ -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/
@@ -119,8 +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 dt_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,
@@ -130,7 +129,7 @@ static inline int mdd_orphan_delete_obj(const struct lu_env *env,
 {
        struct dt_object *dor = mdd->mdd_orphans;
 
-       return dt_delete(env, dor, key, th, BYPASS_CAPA);
+       return dt_delete(env, dor, key, th);
 }
 
 static inline int mdd_orphan_ref_add(const struct lu_env *env,
@@ -227,12 +226,12 @@ static int orph_index_insert(const struct lu_env *env,
         if (!dt_try_as_dir(env, next))
                GOTO(out, rc = 0);
 
-       dt_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;
        dt_insert(env, next, (const struct dt_rec *)rec,
-                 (const struct dt_key *)dotdot, th, BYPASS_CAPA, 1);
+                 (const struct dt_key *)dotdot, th, 1);
 
 out:
         if (rc == 0)
@@ -319,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)) {
@@ -333,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))) {
@@ -357,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);
 }
 
 /**
@@ -440,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",