Whamcloud - gitweb
LU-4199 libcfs: remove assertion of spin_is_locked()
[fs/lustre-release.git] / lustre / osc / osc_cl_internal.h
index d1a3dbf..4a62b3c 100644 (file)
@@ -201,7 +201,16 @@ static inline void osc_object_unlock(struct osc_object *obj)
 
 static inline int osc_object_is_locked(struct osc_object *obj)
 {
+#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
        return spin_is_locked(&obj->oo_lock);
+#else
+       /*
+        * It is not perfect to return true all the time.
+        * But since this function is only used for assertion
+        * and checking, it seems OK.
+        */
+       return 1;
+#endif
 }
 
 /*