Whamcloud - gitweb
LU-4165 tests: skip sanity-lfsck test_2c for 2.4 or older
[fs/lustre-release.git] / lustre / osc / osc_cl_internal.h
index 2623715..a8c2ec5 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, Whamcloud, Inc.
+ * Copyright (c) 2012, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -123,7 +123,7 @@ struct osc_object {
          */
         int                oo_contended;
         cfs_time_t         oo_contention_time;
-#ifdef INVARIANT_CHECK
+#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
         /**
          * IO context used for invariant checks in osc_lock_has_pages().
          */
@@ -383,14 +383,14 @@ struct osc_page {
                 */
                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;
+       /**
+        * Thread that submitted this page for transfer. For debugging.
+        */
+       struct task_struct           *ops_submitter;
+       /**
+        * Submit time - the time when the page is starting RPC. For debugging.
+        */
+       cfs_time_t            ops_submit_time;
 
         /**
          * A lock of which we hold a reference covers this page. Only used by
@@ -403,13 +403,12 @@ struct osc_page {
         struct cl_lock       *ops_lock;
 };
 
-extern cfs_mem_cache_t *osc_page_kmem;
-extern cfs_mem_cache_t *osc_lock_kmem;
-extern cfs_mem_cache_t *osc_object_kmem;
-extern cfs_mem_cache_t *osc_thread_kmem;
-extern cfs_mem_cache_t *osc_session_kmem;
-extern cfs_mem_cache_t *osc_req_kmem;
-extern cfs_mem_cache_t *osc_extent_kmem;
+extern struct kmem_cache *osc_lock_kmem;
+extern struct kmem_cache *osc_object_kmem;
+extern struct kmem_cache *osc_thread_kmem;
+extern struct kmem_cache *osc_session_kmem;
+extern struct kmem_cache *osc_req_kmem;
+extern struct kmem_cache *osc_extent_kmem;
 
 extern struct lu_device_type osc_device_type;
 extern struct lu_context_key osc_key;
@@ -427,12 +426,9 @@ int osc_req_init (const struct lu_env *env, struct cl_device *dev,
 struct lu_object *osc_object_alloc(const struct lu_env *env,
                                    const struct lu_object_header *hdr,
                                    struct lu_device *dev);
-struct cl_page   *osc_page_init   (const struct lu_env *env,
-                                   struct cl_object *obj,
-                                   struct cl_page *page, cfs_page_t *vmpage);
+int osc_page_init(const struct lu_env *env, struct cl_object *obj,
+                 struct cl_page *page, struct page *vmpage);
 
-void osc_lock_build_res(const struct lu_env *env, const struct osc_object *obj,
-                        struct ldlm_res_id *resname);
 void osc_index2policy  (ldlm_policy_data_t *policy, const struct cl_object *obj,
                         pgoff_t start, pgoff_t end);
 int  osc_lvb_print     (const struct lu_env *env, void *cookie,
@@ -444,7 +440,7 @@ int osc_cancel_async_page(const struct lu_env *env, struct osc_page *ops);
 int osc_set_async_flags(struct osc_object *obj, struct osc_page *opg,
                        obd_flag async_flags);
 int osc_prep_async_page(struct osc_object *osc, struct osc_page *ops,
-                       cfs_page_t *page, loff_t offset);
+                       struct page *page, loff_t offset);
 int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
                       struct osc_page *ops);
 int osc_teardown_async_page(const struct lu_env *env, struct osc_object *obj,
@@ -600,8 +596,6 @@ enum osc_extent_state {
        OES_TRUNC     = 6, /** being truncated */
        OES_STATE_MAX
 };
-#define OES_STRINGS { "inv", "active", "cache", "locking", "lockdone", "rpc", \
-                     "trunc", NULL }
 
 /**
  * osc_extent data to manage dirty pages.
@@ -674,11 +668,11 @@ struct osc_extent {
        pgoff_t            oe_max_end;
        /** waitqueue - for those who want to be notified if this extent's
         * state has changed. */
-       cfs_waitq_t        oe_waitq;
+       wait_queue_head_t        oe_waitq;
        /** lock covering this extent */
        struct cl_lock    *oe_osclock;
        /** terminator of this extent. Must be true if this extent is in IO. */
-       cfs_task_t        *oe_owner;
+       struct task_struct        *oe_owner;
        /** return value of writeback. If somebody is waiting for this extent,
         * this value can be known by outside world. */
        int                oe_rc;