Whamcloud - gitweb
LU-1729: lu_buf code cleaning
[fs/lustre-release.git] / lustre / include / lu_object.h
index 5f07f9d..175de05 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -174,8 +172,9 @@ struct lu_device_operations {
  * For lu_object_conf flags
  */
 typedef enum {
-        /* Currently, only used for client-side object initialization. */
-        LOC_F_NEW = 0x1,
+       /* This is a new object to be allocated, or the file
+        * corresponding to the object does not exists. */
+       LOC_F_NEW       = 0x00000001,
 } loc_flags_t;
 
 /**
@@ -629,6 +628,10 @@ struct lu_site {
          * Top-level device for this stack.
          */
         struct lu_device         *ls_top_dev;
+       /**
+        * Bottom-level device for this stack
+        */
+       struct lu_device        *ls_bottom_dev;
         /**
          * Linkage into global list of sites.
          */
@@ -645,6 +648,10 @@ struct lu_site {
          */
         struct lprocfs_stats     *ls_stats;
         struct lprocfs_stats     *ls_time_stats;
+       /**
+        * XXX: a hack! fld has to find md_site via site, remove when possible
+        */
+       struct md_site           *ld_md_site;
 };
 
 static inline struct lu_site_bkt_data *
@@ -677,6 +684,9 @@ void lu_object_fini       (struct lu_object *o);
 void lu_object_add_top    (struct lu_object_header *h, struct lu_object *o);
 void lu_object_add        (struct lu_object *before, struct lu_object *o);
 
+void lu_dev_add_linkage(struct lu_site *s, struct lu_device *d);
+void lu_dev_del_linkage(struct lu_site *s, struct lu_device *d);
+
 /**
  * Helpers to initialize and finalize device types.
  */
@@ -713,6 +723,7 @@ static inline int lu_object_is_dying(const struct lu_object_header *h)
 }
 
 void lu_object_put(const struct lu_env *env, struct lu_object *o);
+void lu_object_put_nocache(const struct lu_env *env, struct lu_object *o);
 
 int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr);
 
@@ -945,6 +956,7 @@ struct lu_context {
          * from enum lu_context_tag.
          */
         __u32                  lc_tags;
+       enum lu_context_state  lc_state;
         /**
          * Pointer to the home service thread. NULL for other execution
          * contexts.
@@ -955,7 +967,6 @@ struct lu_context {
          * detail.
          */
         void                 **lc_value;
-        enum lu_context_state  lc_state;
         /**
          * Linkage into a list of all remembered contexts. Only
          * `non-transient' contexts, i.e., ones created for service threads
@@ -1295,7 +1306,7 @@ struct lu_buf {
 /** null buffer */
 extern struct lu_buf LU_BUF_NULL;
 
-#define DLUBUF "(%p %z)"
+#define DLUBUF "(%p %zu)"
 #define PLUBUF(buf) (buf)->lb_buf, (buf)->lb_len
 /**
  * One-time initializers, called at obdclass module initialization, not
@@ -1330,5 +1341,11 @@ struct lu_kmem_descr {
 int  lu_kmem_init(struct lu_kmem_descr *caches);
 void lu_kmem_fini(struct lu_kmem_descr *caches);
 
+void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o,
+                         const struct lu_fid *fid);
+struct lu_object *lu_object_anon(const struct lu_env *env,
+                                struct lu_device *dev,
+                                const struct lu_object_conf *conf);
+
 /** @} lu */
 #endif /* __LUSTRE_LU_OBJECT_H */