Whamcloud - gitweb
ORNL-2 Enable OBD_CONNECT_ATTRFID supporting on lustre-2.x
[fs/lustre-release.git] / lustre / ldlm / ldlm_extent.c
index 780296d..8232d6f 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -289,10 +289,10 @@ static int ldlm_check_contention(struct ldlm_lock *lock, int contended_locks)
                 return 1;
 
         CDEBUG(D_DLMTRACE, "contended locks = %d\n", contended_locks);
-        if (contended_locks > res->lr_namespace->ns_contended_locks)
+        if (contended_locks > ldlm_res_to_ns(res)->ns_contended_locks)
                 res->lr_contention_time = now;
         return cfs_time_before(now, cfs_time_add(res->lr_contention_time,
-                cfs_time_seconds(res->lr_namespace->ns_contention_time)));
+                cfs_time_seconds(ldlm_res_to_ns(res)->ns_contention_time)));
 }
 
 struct ldlm_extent_compat_args {
@@ -600,7 +600,7 @@ ldlm_extent_compat_queue(cfs_list_t *queue, struct ldlm_lock *req,
             (*flags & LDLM_FL_DENY_ON_CONTENTION) &&
             req->l_req_mode != LCK_GROUP &&
             req_end - req_start <=
-            req->l_resource->lr_namespace->ns_max_nolock_size)
+            ldlm_res_to_ns(req->l_resource)->ns_max_nolock_size)
                 GOTO(destroylock, compat = -EUSERS);
 
         RETURN(compat);
@@ -711,7 +711,7 @@ int ldlm_process_extent_lock(struct ldlm_lock *lock, int *flags, int first_enq,
                 rc = ldlm_run_ast_work(&rpc_list, LDLM_WORK_BL_AST);
 
                 if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_OST_FAIL_RACE) &&
-                    !ns_is_client(res->lr_namespace))
+                    !ns_is_client(ldlm_res_to_ns(res)))
                         class_fail_export(lock->l_export);
  
                 lock_res(res);
@@ -760,7 +760,7 @@ out:
 
 /* When a lock is cancelled by a client, the KMS may undergo change if this
  * is the "highest lock".  This function returns the new KMS value.
- * Caller must hold ns_lock already.
+ * Caller must hold lr_lock already.
  *
  * NB: A lock on [x,y] protects a KMS of up to y + 1 bytes! */
 __u64 ldlm_extent_shift_kms(struct ldlm_lock *lock, __u64 old_kms)