Whamcloud - gitweb
Branch HEAD
authorvitaly <vitaly>
Fri, 10 Apr 2009 19:40:39 +0000 (19:40 +0000)
committervitaly <vitaly>
Fri, 10 Apr 2009 19:40:39 +0000 (19:40 +0000)
b=18792
i=jay
i=huanghua

1. remove the assert for inode reference in cl_inode_fini().
2. as ldlm_cli_cancel() takes a "long" lock, i.e. without a reference,
we should not drop this reference later. --enable-lu_ref fix.

lustre/include/lclient.h
lustre/lclient/lcommon_cl.c
lustre/ldlm/ldlm_request.c
lustre/liblustre/llite_cl.c
lustre/llite/vvp_lock.c
lustre/osc/osc_lock.c

index 6d60864..c0c6cd0 100644 (file)
@@ -305,6 +305,8 @@ void ccc_transient_page_discard(const struct lu_env *env,
 int ccc_transient_page_prep(const struct lu_env *env,
                             const struct cl_page_slice *slice,
                             struct cl_io *io);
+void ccc_lock_delete(const struct lu_env *env,
+                     const struct cl_lock_slice *slice);
 void ccc_lock_fini(const struct lu_env *env,struct cl_lock_slice *slice);
 int ccc_lock_enqueue(const struct lu_env *env,const struct cl_lock_slice *slice,
                      struct cl_io *io, __u32 enqflags);
index b161c11..569f165 100644 (file)
@@ -560,11 +560,15 @@ int ccc_transient_page_prep(const struct lu_env *env,
  *
  */
 
+void ccc_lock_delete(const struct lu_env *env,
+                     const struct cl_lock_slice *slice)
+{
+        CLOBINVRNT(env, slice->cls_obj, ccc_object_invariant(slice->cls_obj));
+}
+
 void ccc_lock_fini(const struct lu_env *env, struct cl_lock_slice *slice)
 {
         struct ccc_lock *clk = cl2ccc_lock(slice);
-
-        CLOBINVRNT(env, slice->cls_obj, ccc_object_invariant(slice->cls_obj));
         OBD_SLAB_FREE_PTR(clk, ccc_lock_kmem);
 }
 
@@ -1171,7 +1175,6 @@ void cl_inode_fini(struct inode *inode)
         int emergency;
 
         if (clob != NULL) {
-                struct lu_object_header *head = clob->co_lu.lo_header;
                 void                    *cookie;
 
                 cookie = cl_env_reenter();
@@ -1190,8 +1193,6 @@ void cl_inode_fini(struct inode *inode)
                  */
                 cl_object_kill(env, clob);
                 lu_object_ref_del(&clob->co_lu, "inode", inode);
-                /* XXX temporary: this is racy */
-                LASSERT(atomic_read(&head->loh_ref) == 1);
                 cl_object_put(env, clob);
                 lli->lli_clob = NULL;
                 if (emergency) {
index d120548..b6fb1d1 100644 (file)
@@ -1244,7 +1244,7 @@ int ldlm_cli_cancel(struct lustre_handle *lockh)
 
         rc = ldlm_cli_cancel_local(lock);
         if (rc < 0 || rc == LDLM_FL_LOCAL_ONLY) {
-                LDLM_LOCK_PUT(lock);
+                LDLM_LOCK_RELEASE(lock);
                 RETURN(rc < 0 ? rc : 0);
         }
         /* Even if the lock is marked as LDLM_FL_BL_AST, this is a LDLM_CANCEL
index ebd5064..0a29220 100644 (file)
@@ -414,6 +414,7 @@ static int slp_lock_enqueue(const struct lu_env *env,
 }
 
 static const struct cl_lock_operations slp_lock_ops = {
+        .clo_delete    = ccc_lock_delete,
         .clo_fini      = ccc_lock_fini,
         .clo_enqueue   = slp_lock_enqueue,
         .clo_wait      = ccc_lock_wait,
index f0c487d..846934c 100644 (file)
@@ -73,6 +73,7 @@ static unsigned long vvp_lock_weigh(const struct lu_env *env,
 }
 
 static const struct cl_lock_operations vvp_lock_ops = {
+        .clo_delete    = ccc_lock_delete,
         .clo_fini      = ccc_lock_fini,
         .clo_enqueue   = ccc_lock_enqueue,
         .clo_wait      = ccc_lock_wait,
index 742c399..c3b2fee 100644 (file)
@@ -210,8 +210,7 @@ static void osc_lock_fini(const struct lu_env *env,
          */
         if (ols->ols_hold)
                 osc_lock_unuse(env, slice);
-        if (ols->ols_lock != NULL)
-                osc_lock_detach(env, ols);
+        LASSERT(ols->ols_lock == NULL);
 
         OBD_SLAB_FREE_PTR(ols, osc_lock_kmem);
 }