Whamcloud - gitweb
LU-2469 test: Skip failing ZFS tests
[fs/lustre-release.git] / lustre / mdd / mdd_orphans.c
index 77944c6..e364903 100644 (file)
@@ -64,7 +64,7 @@ enum {
 static struct dt_key* orph_key_fill(const struct lu_env *env,
                                     const struct lu_fid *lf, __u32 op)
 {
-        char *key = mdd_env_info(env)->mti_orph_key;
+       char *key = mdd_env_info(env)->mti_key;
         int rc;
 
         LASSERT(key);
@@ -80,7 +80,7 @@ static struct dt_key* orph_key_fill(const struct lu_env *env,
 static struct dt_key* orph_key_fill_18(const struct lu_env *env,
                                        const struct lu_fid *lf)
 {
-        char *key = mdd_env_info(env)->mti_orph_key;
+       char *key = mdd_env_info(env)->mti_key;
         int rc;
 
         LASSERT(key);
@@ -155,41 +155,41 @@ static inline void mdd_orphan_ref_del(const struct lu_env *env,
 
 
 int orph_declare_index_insert(const struct lu_env *env,
-                              struct mdd_object *obj,
-                              struct thandle *th)
+                             struct mdd_object *obj,
+                             cfs_umode_t mode, struct thandle *th)
 {
-        struct mdd_device *mdd = mdo2mdd(&obj->mod_obj);
-       struct dt_key     *key;
-        int                rc;
+       struct mdd_device       *mdd = mdo2mdd(&obj->mod_obj);
+       struct dt_key           *key;
+       int                     rc;
 
        key = orph_key_fill(env, mdo2fid(obj), ORPH_OP_UNLINK);
 
        rc = dt_declare_insert(env, mdd->mdd_orphans, NULL, key, th);
-        if (rc)
-                return rc;
+       if (rc)
+               return rc;
 
-        rc = mdo_declare_ref_add(env, obj, th);
-        if (rc)
-                return rc;
+       rc = mdo_declare_ref_add(env, obj, th);
+       if (rc)
+               return rc;
 
-        if (!S_ISDIR(mdd_object_type(obj)))
-                return 0;
+       if (!S_ISDIR(mode))
+               return 0;
 
-        rc = mdo_declare_ref_add(env, obj, th);
-        if (rc)
-                return rc;
+       rc = mdo_declare_ref_add(env, obj, th);
+       if (rc)
+               return rc;
 
-        rc = dt_declare_ref_add(env, mdd->mdd_orphans, th);
-        if (rc)
-                return rc;
+       rc = dt_declare_ref_add(env, mdd->mdd_orphans, th);
+       if (rc)
+               return rc;
 
-        rc = mdo_declare_index_delete(env, obj, dotdot, th);
-        if (rc)
-                return rc;
+       rc = mdo_declare_index_delete(env, obj, dotdot, th);
+       if (rc)
+               return rc;
 
-        rc = mdo_declare_index_insert(env, obj, NULL, dotdot, th);
+       rc = mdo_declare_index_insert(env, obj, NULL, dotdot, th);
 
-        return rc;
+       return rc;
 }
 
 static int orph_index_insert(const struct lu_env *env,
@@ -206,7 +206,6 @@ static int orph_index_insert(const struct lu_env *env,
 
         LASSERT(mdd_write_locked(env, obj) != 0);
         LASSERT(!(obj->mod_flags & ORPHAN_OBJ));
-        LASSERT(obj->mod_count > 0);
 
         mdd_orphan_write_lock(env, mdd);
 
@@ -428,7 +427,7 @@ static int orph_index_iterate(const struct lu_env *env,
                              struct mdd_device *mdd)
 {
        struct dt_object *dor = mdd->mdd_orphans;
-       struct lu_dirent *ent = &mdd_env_info(env)->mti_orph_ent;
+       struct lu_dirent *ent = &mdd_env_info(env)->mti_ent;
        const struct dt_it_ops *iops;
        struct dt_it     *it;
        struct lu_fid     fid;