Whamcloud - gitweb
LU-3963 libcfs: convert obdecho,obdclass code to atomics
[fs/lustre-release.git] / lustre / obdclass / local_storage.h
index d3f6f6e..4471877 100644 (file)
@@ -29,6 +29,8 @@
  *
  * Author: Mikhail Pershin <mike.pershin@intel.com>
  */
+#ifndef __LOCAL_STORAGE_H
+#define __LOCAL_STORAGE_H
 
 #include <dt_object.h>
 #include <obd.h>
@@ -40,7 +42,7 @@ struct ls_device {
        /* all initialized ls_devices on this node linked by this */
        cfs_list_t               ls_linkage;
        /* how many handle's reference this local storage */
-       cfs_atomic_t             ls_refcount;
+       atomic_t                 ls_refcount;
        /* underlaying OSD device */
        struct dt_device        *ls_osd;
        /* list of all local OID storages */
@@ -74,3 +76,17 @@ struct ls_device *ls_device_get(struct dt_device *dev);
 void ls_device_put(const struct lu_env *env, struct ls_device *ls);
 struct local_oid_storage *dt_los_find(struct ls_device *ls, __u64 seq);
 void dt_los_put(struct local_oid_storage *los);
+
+/* Lustre 2.3 on-disk structure describing local object OIDs storage
+ * the structure to be used with any sequence managed by
+ * local object library.
+ * Obsoleted since 2.4 but is kept for compatibility reasons,
+ * see lastid_compat_check() in obdclass/local_storage.c */
+struct los_ondisk {
+       __u32 lso_magic;
+       __u32 lso_next_oid;
+};
+
+#define LOS_MAGIC      0xdecafbee
+
+#endif