Whamcloud - gitweb
b=17166 remove <2.6.9 compatibility code from HEAD
[fs/lustre-release.git] / lustre / osc / osc_cl_internal.h
index b8cdd3e..16cd956 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -57,7 +57,9 @@
 #include <cl_object.h>
 #include "osc_internal.h"
 
-/** \addtogroup osc osc @{ */
+/** \defgroup osc osc
+ *  @{
+ */
 
 /**
  * State maintained by osc layer for each IO context.
@@ -69,10 +71,10 @@ struct osc_io {
         int                oi_lockless;
 
         struct obdo        oi_oa;
-        struct osc_punch_cbargs {
+        struct osc_setattr_cbargs {
                 int               opc_rc;
-                struct completion opc_sync;
-        } oi_punch_cbarg;
+                cfs_completion_t  opc_sync;
+        } oi_setattr_cbarg;
 };
 
 /**
@@ -95,7 +97,6 @@ struct osc_thread_info {
         struct cl_lock_descr    oti_descr;
         struct cl_attr          oti_attr;
         struct lustre_handle    oti_handle;
-        struct cl_lock_closure  oti_closure;
         struct cl_page_list     oti_plist;
 };
 
@@ -113,17 +114,17 @@ struct osc_object {
          */
         struct cl_io       oo_debug_io;
         /** Serialization object for osc_object::oo_debug_io. */
-        struct mutex       oo_debug_mutex;
+        cfs_mutex_t        oo_debug_mutex;
 #endif
         /**
          * List of pages in transfer.
          */
-        struct list_head   oo_inflight[CRT_NR];
+        cfs_list_t         oo_inflight[CRT_NR];
         /**
          * Lock, protecting ccc_object::cob_inflight, because a seat-belt is
          * locked during take-off and landing.
          */
-        spinlock_t         oo_seatbelt;
+        cfs_spinlock_t     oo_seatbelt;
 };
 
 /*
@@ -244,9 +245,11 @@ struct osc_lock {
                                  ols_glimpse:1;
         /**
          * IO that owns this lock. This field is used for a dead-lock
-         * avoidance by osc_lock_enqueue().
+         * avoidance by osc_lock_enqueue_wait().
          *
-         * \see osc_deadlock_is_possible()
+         * XXX: unfortunately, the owner of a osc_lock is not unique, 
+         * the lock may have multiple users, if the lock is granted and
+         * then matched.
          */
         struct osc_io           *ols_owner;
 };
@@ -280,16 +283,24 @@ struct osc_page {
          * True for a `temporary page' created by read-ahead code, probably
          * outside of any DLM lock.
          */
-                              ops_temp:1;
+                              ops_temp:1,
+        /**
+         * Set if the page must be transferred with OBD_BRW_SRVLOCK.
+         */
+                              ops_srvlock:1;
         /**
          * Linkage into a per-osc_object list of pages in flight. For
          * debugging.
          */
-        struct list_head      ops_inflight;
+        cfs_list_t            ops_inflight;
         /**
          * Thread that submitted this page for transfer. For debugging.
          */
         cfs_task_t           *ops_submitter;
+        /**
+         * Submit time - the time when the page is starting RPC. For debugging.
+         */
+        cfs_time_t            ops_submit_time;
 };
 
 extern cfs_mem_cache_t *osc_page_kmem;