Whamcloud - gitweb
LU-3938 osd-zfs: Account for ZAP when shrinking an xattr
[fs/lustre-release.git] / lustre / lov / lov_cl_internal.h
index d0bb9ae..4b1f083 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, Intel Corporation.
+ * Copyright (c) 2012, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -166,13 +166,28 @@ struct lov_device {
  * Layout type.
  */
 enum lov_layout_type {
-        /** empty file without body */
-        LLT_EMPTY,
-        /** striped file */
-        LLT_RAID0,
-        LLT_NR
+       LLT_EMPTY,      /** empty file without body (mknod + truncate) */
+       LLT_RAID0,      /** striped file */
+       LLT_RELEASED,   /** file with no objects (data in HSM) */
+       LLT_NR
 };
 
+static inline char *llt2str(enum lov_layout_type llt)
+{
+       switch (llt) {
+       case LLT_EMPTY:
+               return "EMPTY";
+       case LLT_RAID0:
+               return "RAID0";
+       case LLT_RELEASED:
+               return "RELEASED";
+       case LLT_NR:
+               LBUG();
+       }
+       LBUG();
+       return "";
+}
+
 /**
  * lov-specific file state.
  *
@@ -215,7 +230,7 @@ struct lov_object {
        /**
         * Waitq - wait for no one else is using lo_lsm
         */
-       cfs_waitq_t            lo_waitq;
+       wait_queue_head_t       lo_waitq;
        /**
         * Layout metadata. NULL if empty layout.
         */
@@ -259,6 +274,8 @@ struct lov_object {
                 } raid0;
                 struct lov_layout_state_empty {
                 } empty;
+               struct lov_layout_state_released {
+               } released;
         } u;
         /**
          * Thread that acquired lov_object::lo_type_guard in an exclusive
@@ -303,7 +320,7 @@ struct lov_lock {
          * Set when sub-lock was canceled, while top-lock was being
          * used, or unused.
          */
-        int                    lls_cancel_race:1;
+       unsigned int           lls_cancel_race:1;
         /**
          * An array of sub-locks
          *
@@ -427,13 +444,13 @@ struct lovsub_page {
 
 
 struct lov_thread_info {
-        struct cl_object_conf   lti_stripe_conf;
-        struct lu_fid           lti_fid;
-        struct cl_lock_descr    lti_ldescr;
-        struct ost_lvb          lti_lvb;
-        struct cl_2queue        lti_cl2q;
-        struct cl_lock_closure  lti_closure;
-        cfs_waitlink_t          lti_waiter;
+       struct cl_object_conf   lti_stripe_conf;
+       struct lu_fid           lti_fid;
+       struct cl_lock_descr    lti_ldescr;
+       struct ost_lvb          lti_lvb;
+       struct cl_2queue        lti_cl2q;
+       struct cl_lock_closure  lti_closure;
+       wait_queue_t            lti_waiter;
 };
 
 /**
@@ -555,17 +572,17 @@ extern struct lu_device_type lovsub_device_type;
 extern struct lu_context_key lov_key;
 extern struct lu_context_key lov_session_key;
 
-extern cfs_mem_cache_t *lov_lock_kmem;
-extern cfs_mem_cache_t *lov_object_kmem;
-extern cfs_mem_cache_t *lov_thread_kmem;
-extern cfs_mem_cache_t *lov_session_kmem;
-extern cfs_mem_cache_t *lov_req_kmem;
+extern struct kmem_cache *lov_lock_kmem;
+extern struct kmem_cache *lov_object_kmem;
+extern struct kmem_cache *lov_thread_kmem;
+extern struct kmem_cache *lov_session_kmem;
+extern struct kmem_cache *lov_req_kmem;
 
-extern cfs_mem_cache_t *lovsub_lock_kmem;
-extern cfs_mem_cache_t *lovsub_object_kmem;
-extern cfs_mem_cache_t *lovsub_req_kmem;
+extern struct kmem_cache *lovsub_lock_kmem;
+extern struct kmem_cache *lovsub_object_kmem;
+extern struct kmem_cache *lovsub_req_kmem;
 
-extern cfs_mem_cache_t *lov_lock_link_kmem;
+extern struct kmem_cache *lov_lock_link_kmem;
 
 int   lov_object_init     (const struct lu_env *env, struct lu_object *obj,
                            const struct lu_object_conf *conf);
@@ -586,6 +603,8 @@ int   lov_io_init_raid0   (const struct lu_env *env, struct cl_object *obj,
                            struct cl_io *io);
 int   lov_io_init_empty   (const struct lu_env *env, struct cl_object *obj,
                            struct cl_io *io);
+int   lov_io_init_released(const struct lu_env *env, struct cl_object *obj,
+                           struct cl_io *io);
 void  lov_lock_unlink     (const struct lu_env *env, struct lov_lock_link *link,
                            struct lovsub_lock *sub);
 
@@ -598,16 +617,16 @@ int   lov_sublock_modify  (const struct lu_env *env, struct lov_lock *lov,
 
 
 int   lov_page_init       (const struct lu_env *env, struct cl_object *ob,
-                           struct cl_page *page, cfs_page_t *vmpage);
+                          struct cl_page *page, struct page *vmpage);
 int   lovsub_page_init    (const struct lu_env *env, struct cl_object *ob,
-                           struct cl_page *page, cfs_page_t *vmpage);
+                          struct cl_page *page, struct page *vmpage);
 
 int   lov_page_init_empty (const struct lu_env *env,
                            struct cl_object *obj,
-                           struct cl_page *page, cfs_page_t *vmpage);
+                          struct cl_page *page, struct page *vmpage);
 int   lov_page_init_raid0 (const struct lu_env *env,
                            struct cl_object *obj,
-                           struct cl_page *page, cfs_page_t *vmpage);
+                          struct cl_page *page, struct page *vmpage);
 struct lu_object *lov_object_alloc   (const struct lu_env *env,
                                       const struct lu_object_header *hdr,
                                       struct lu_device *dev);