Whamcloud - gitweb
Add some basic data integrity checking to obdecho.
[fs/lustre-release.git] / lustre / include / linux / obd.h
index e94f8b8..8474b78 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,6 +24,12 @@ struct obd_type {
         int  typ_refcnt;
 };
 
+struct brw_page { 
+        struct page *pg;
+        obd_size count;
+        obd_off  off;
+        obd_flag flag;
+};
 
 /* Individual type definitions */
 
@@ -42,6 +49,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;
@@ -69,15 +82,6 @@ struct client_obd {
         int cl_max_mdsize;
 };
 
-#if 0
-struct osc_obd {
-        struct ptlrpc_client *osc_client;
-        struct ptlrpc_client *osc_ldlm_client;
-        struct ptlrpc_connection *osc_conn;
-        __u8 osc_target_uuid[37];
-};
-#endif
-
 struct mds_obd {
         struct ptlrpc_service *mds_service;
 
@@ -208,7 +212,7 @@ struct obd_device {
         } u;
 };
 
-typedef void (*brw_callback_t)(void *);
+struct io_cb_data;
 
 struct obd_ops {
         int (*o_iocontrol)(long cmd, struct lustre_handle *, int len,
@@ -243,8 +247,8 @@ struct obd_ops {
                        struct lov_stripe_md *);
         int (*o_brw)(int rw, struct lustre_handle *conn,
                      struct lov_stripe_md *md, obd_count oa_bufs,
-                     struct page **buf, obd_size *count, obd_off *offset,
-                     obd_flag *flags, brw_callback_t callback, void * data);
+                     struct brw_page *pgarr, brw_callback_t callback, 
+                     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);
@@ -266,13 +270,17 @@ struct obd_ops {
                           int objcount, struct obd_ioobj *obj,
                           int niocount, struct niobuf_local *local,
                           void *desc_private);
-        int (*o_enqueue)(struct lustre_handle *conn,
-                         struct lustre_handle *parent_lock, __u64 *res_id,
+        int (*o_enqueue)(struct lustre_handle *conn, struct lov_stripe_md *md,
+                         struct lustre_handle *parent_lock, 
                          __u32 type, void *cookie, int cookielen, __u32 mode,
                          int *flags, void *cb, void *data, int datalen,
                          struct lustre_handle *lockh);
-        int (*o_cancel)(struct lustre_handle *, __u32 mode,
-                        struct lustre_handle *);
+        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