Whamcloud - gitweb
We get 64-bit xids over the wire, so we should store 64 bits on disk.
[fs/lustre-release.git] / lustre / include / linux / obd.h
index 6156266..eccf74f 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/smp_lock.h>
 #include <linux/proc_fs.h>
 
+#include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
 
 struct obd_type {
@@ -23,7 +24,6 @@ struct obd_type {
         int  typ_refcnt;
 };
 
-typedef int (*brw_callback_t)(void *, int err, int phase);
 struct brw_page { 
         struct page *pg;
         obd_size count;
@@ -31,6 +31,33 @@ struct brw_page {
         obd_flag flag;
 };
 
+struct lov_oinfo { /* per-child structure */
+        __u64 loi_id;
+        __u64 loi_size;
+};
+
+struct lov_stripe_md {
+        __u32 lmd_magic;
+        __u32 lmd_easize;          /* packed size for MDS of ea */
+        __u64 lmd_object_id;       /* lov object id */
+        __u64 lmd_stripe_offset;   /* offset of the stripe */ 
+        __u64 lmd_stripe_size;     /* size of the stripe */
+        __u32 lmd_stripe_count;    /* how many objects are being striped */
+        __u32 lmd_stripe_pattern;  /* per-lov object stripe pattern */
+        struct lov_oinfo lmd_oinfo[0];
+};
+
+struct lov_stripe_md_one {
+        __u32 lmd_magic;
+        __u32 lmd_easize;          /* packed size for MDS of ea */
+        __u64 lmd_object_id;       /* lov object id */
+        __u64 lmd_stripe_offset;   /* offset of the stripe */ 
+        __u64 lmd_stripe_size;     /* size of the stripe */
+        __u32 lmd_stripe_count;    /* how many objects are being striped */
+        __u32 lmd_stripe_pattern;  /* per-lov object stripe pattern */
+        struct lov_oinfo lmd_oinfo[1];
+};
+
 /* Individual type definitions */
 
 struct ext2_obd {
@@ -49,6 +76,12 @@ struct obd_run_ctxt {
 #endif
 };
 
+#ifdef OBD_CTXT_DEBUG
+#define OBD_SET_CTXT_MAGIC(ctxt) (ctxt)->magic = OBD_RUN_CTXT_MAGIC
+#else
+#define OBD_SET_CTXT_MAGIC(ctxt) do {} while(0)
+#endif
+
 struct filter_obd {
         char *fo_fstype;
         struct super_block *fo_sb;
@@ -118,13 +151,11 @@ struct echo_obd {
 struct recovd_obd {
         time_t                recovd_waketime;
         time_t                recovd_timeout;
-        struct ptlrpc_service *recovd_service;
-        struct ptlrpc_client  *recovd_client;
-        __u32                  recovd_flags; 
-        __u32                  recovd_wakeup_flag; 
-        spinlock_t             recovd_lock;
-        struct list_head      recovd_clients_lh; /* clients managed  */
-        struct list_head      recovd_troubled_lh; /* clients in trouble */
+        __u32                 recovd_flags; 
+        __u32                 recovd_wakeup_flag; 
+        spinlock_t            recovd_lock;
+        struct list_head      recovd_managed_items; /* items managed  */
+        struct list_head      recovd_troubled_items; /* items in trouble */
         wait_queue_head_t     recovd_recovery_waitq;
         wait_queue_head_t     recovd_ctl_waitq;
         wait_queue_head_t     recovd_waitq;
@@ -206,6 +237,7 @@ struct obd_device {
         } u;
 };
 
+struct io_cb_data;
 
 struct obd_ops {
         int (*o_iocontrol)(long cmd, struct lustre_handle *, int len,
@@ -241,7 +273,7 @@ struct obd_ops {
         int (*o_brw)(int rw, struct lustre_handle *conn,
                      struct lov_stripe_md *md, obd_count oa_bufs,
                      struct brw_page *pgarr, brw_callback_t callback, 
-                     void * data);
+                     struct io_cb_data *data);
         int (*o_punch)(struct lustre_handle *conn, struct obdo *tgt,
                        struct lov_stripe_md *md, obd_size count,
                        obd_off offset);
@@ -271,4 +303,9 @@ struct obd_ops {
         int (*o_cancel)(struct lustre_handle *, struct lov_stripe_md *md, __u32 mode, struct lustre_handle *);
 };
 
+/* FIXME: for 64-bit arch */
+#define LPU64 "%Lu"
+#define LPD64 "%Ld"
+#define LPX64 "%Lx"
+
 #endif