Whamcloud - gitweb
LU-1866 lfsck: LFSCK main engine
[fs/lustre-release.git] / lustre / lod / lod_object.c
index f082c91..fd36da5 100644 (file)
@@ -124,8 +124,6 @@ static struct dt_it *lod_it_init(const struct lu_env *env,
 
 #define LOD_CHECK_IT(env, it)                                  \
 {                                                              \
-       /* IT is supposed to be in thread info always */        \
-       LASSERT((it) == &lod_env_info(env)->lti_it);            \
        LASSERT((it)->lit_obj != NULL);                         \
        LASSERT((it)->lit_it != NULL);                          \
 } while(0)
@@ -689,7 +687,7 @@ static void lod_ah_init(const struct lu_env *env,
         * in case of late striping creation, ->ah_init()
         * can be called with local object existing
         */
-       if (!dt_object_exists(nextc))
+       if (!dt_object_exists(nextc) || dt_object_remote(nextc))
                nextc->do_ops->do_ah_init(env, ah, nextp, nextc, child_mode);
 
        if (S_ISDIR(child_mode)) {
@@ -876,7 +874,6 @@ static int lod_declare_object_create(const struct lu_env *env,
        LASSERT(dof);
        LASSERT(attr);
        LASSERT(th);
-       LASSERT(!dt_object_exists(next));
 
        /*
         * first of all, we declare creation of local object
@@ -1131,6 +1128,26 @@ struct dt_object_operations lod_obj_ops = {
        .do_object_sync         = lod_object_sync,
 };
 
+static int lod_object_lock(const struct lu_env *env,
+                          struct dt_object *dt, struct lustre_handle *lh,
+                          struct ldlm_enqueue_info *einfo,
+                          void *policy)
+{
+       struct dt_object   *next = dt_object_child(dt);
+       int              rc;
+       ENTRY;
+
+       /*
+        * declare setattr on the local object
+        */
+       rc = dt_object_lock(env, next, lh, einfo, policy);
+
+       RETURN(rc);
+}
+
+struct dt_lock_operations lod_lock_ops = {
+       .do_object_lock       = lod_object_lock,
+};
 static ssize_t lod_read(const struct lu_env *env, struct dt_object *dt,
                        struct lu_buf *buf, loff_t *pos,
                        struct lustre_capa *capa)