Whamcloud - gitweb
LU-1067 obdecho: Recheck client env ctx for echo md client.
[fs/lustre-release.git] / lustre / include / lu_object.h
index 15ebba6..60b8ea6 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  */
@@ -169,11 +172,23 @@ struct lu_device_operations {
 };
 
 /**
+ * For lu_object_conf flags
+ */
+typedef enum {
+        /* Currently, only used for client-side object initialization. */
+        LOC_F_NEW = 0x1,
+} loc_flags_t;
+
+/**
  * Object configuration, describing particulars of object being created. On
  * server this is not used, as server objects are full identified by fid. On
  * client configuration contains struct lustre_md.
  */
 struct lu_object_conf {
+        /**
+         * Some hints for obj find and alloc.
+         */
+        loc_flags_t     loc_flags;
 };
 
 /**
@@ -278,6 +293,10 @@ struct lu_device {
          * A list of references to this object, for debugging.
          */
         struct lu_ref                      ld_reference;
+        /**
+         * Link the device to the site.
+         **/
+        cfs_list_t                         ld_linkage;
 };
 
 struct lu_device_type_operations;
@@ -445,6 +464,8 @@ enum la_valid {
         LA_NLINK  = 1 << 10,
         LA_RDEV   = 1 << 11,
         LA_BLKSIZE = 1 << 12,
+        LA_KILL_SUID = 1 << 13,
+        LA_KILL_SGID = 1 << 14,
 };
 
 /**
@@ -614,6 +635,13 @@ struct lu_site {
          */
         cfs_list_t                ls_linkage;
         /**
+         * List for lu device for this site, protected
+         * by ls_ld_lock.
+         **/
+        cfs_list_t                ls_ld_linkage;
+        cfs_spinlock_t            ls_ld_lock;
+
+        /**
          * lu_site stats
          */
         struct lprocfs_stats     *ls_stats;
@@ -815,6 +843,7 @@ int lu_object_invariant(const struct lu_object *o);
 
 /**
  * \retval  1 iff object \a o exists on stable storage,
+ * \retval  0 iff object \a o not exists on stable storage.
  * \retval -1 iff object \a o is on remote server.
  */
 static inline int lu_object_exists(const struct lu_object *o)
@@ -1218,6 +1247,14 @@ void lu_context_key_degister_many(struct lu_context_key *k, ...);
 void lu_context_key_revive_many  (struct lu_context_key *k, ...);
 void lu_context_key_quiesce_many (struct lu_context_key *k, ...);
 
+/*
+ * update/clear ctx/ses tags.
+ */
+void lu_context_tags_update(__u32 tags);
+void lu_context_tags_clear(__u32 tags);
+void lu_session_tags_update(__u32 tags);
+void lu_session_tags_clear(__u32 tags);
+
 /**
  * Environment.
  */
@@ -1235,6 +1272,7 @@ struct lu_env {
 int  lu_env_init  (struct lu_env *env, __u32 tags);
 void lu_env_fini  (struct lu_env *env);
 int  lu_env_refill(struct lu_env *env);
+int  lu_env_refill_by_tags(struct lu_env *env, __u32 ctags, __u32 stags);
 
 /** @} lu_context */
 
@@ -1259,7 +1297,6 @@ struct lu_name {
 struct lu_buf {
         void   *lb_buf;
         ssize_t lb_len;
-        int     lb_vmalloc:1;
 };
 
 /** null buffer */