Whamcloud - gitweb
WARNING: This commit breaks everything. It will be back in shape within 12
[fs/lustre-release.git] / lustre / include / linux / obd.h
index 0e80c8d..b7b2014 100644 (file)
@@ -57,6 +57,8 @@ struct filter_obd {
         struct super_block *fo_sb;
         struct vfsmount *fo_vfsmnt;
         struct obd_run_ctxt fo_ctxt;
+        struct dentry *fo_dentry_O;
+        struct dentry *fo_dentry_O_mode[16];
         spinlock_t fo_lock;
         __u64 fo_lastino;
         struct file_operations *fo_fop;
@@ -64,19 +66,29 @@ struct filter_obd {
         struct address_space_operations *fo_aops;
 };
 
+struct mds_client_info;
+struct mds_server_data;
+
 struct mds_obd {
         struct ptlrpc_service *mds_service;
 
         char *mds_fstype;
         struct super_block *mds_sb;
+        struct super_operations *mds_sop;
         struct vfsmount *mds_vfsmnt;
         struct obd_run_ctxt mds_ctxt;
         struct file_operations *mds_fop;
         struct inode_operations *mds_iop;
         struct address_space_operations *mds_aops;
         struct mds_fs_operations *mds_fsops;
-        struct file *mds_last_rcvd;
+        struct file *mds_rcvd_filp;
+        __u64 mds_last_committed;
+        __u64 mds_last_rcvd;
         __u64 mds_mount_count;
+        struct ll_fid mds_rootfid;
+        int mds_client_count;
+        struct list_head mds_client_info;
+        struct mds_server_data *mds_server_data;
 };
 
 struct ldlm_obd {
@@ -97,18 +109,20 @@ struct echo_obd {
         struct address_space_operations *eo_aops;
 };
 
-struct connmgr_obd {
-        time_t                mgr_waketime;
-        time_t                mgr_timeout;
-        struct ptlrpc_service *mgr_service;
-        struct ptlrpc_client  *mgr_client;
-        __u32                  mgr_flags; 
-        spinlock_t             mgr_lock;
-        struct list_head      mgr_connections_lh; /* connections managed by the mgr */
-        struct list_head      mgr_troubled_lh; /* connections in trouble */
-        wait_queue_head_t     mgr_ctl_waitq;
-        wait_queue_head_t     mgr_waitq;
-        struct task_struct    *mgr_thread;
+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 */
+        wait_queue_head_t     recovd_recovery_waitq;
+        wait_queue_head_t     recovd_ctl_waitq;
+        wait_queue_head_t     recovd_waitq;
+        struct task_struct    *recovd_thread;
 };
 
 struct trace_obd {
@@ -141,13 +155,31 @@ struct ost_obd {
 struct osc_obd {
         struct obd_device *osc_tgt;
         struct ptlrpc_client *osc_client;
+        struct ptlrpc_client *osc_ldlm_client;
         struct ptlrpc_connection *osc_conn;
 };
 
-/* corresponds to one of the obd's */
+typedef __u8 uuid_t[37];
+
 #define MAX_MULTI       16
+struct lov_obd {
+        __u32 lov_default_count;
+        __u32 lov_default_pattern;
+        __u32 lov_default_size;
+        uuid_t lov_service_uuids[MAX_MULTI];
+
+#if 0
+        int lov_count;
+        struct obd_conn *lov_targets;
+#endif
+};
+
+/* corresponds to one of the obd's */
 struct obd_device {
         struct obd_type *obd_type;
+        char *obd_name;
+        __u8 obd_uuid[37];
+
         int obd_minor;
         int obd_flags;
         int obd_refcnt;
@@ -160,6 +192,7 @@ struct obd_device {
         struct list_head obd_gen_clients;
         struct list_head obd_req_list;
         wait_queue_head_t obd_req_waitq;
+        struct ldlm_namespace *obd_namespace;
         union {
                 struct ext2_obd ext2;
                 struct filter_obd filter;
@@ -168,8 +201,9 @@ struct obd_device {
                 struct osc_obd osc;
                 struct ldlm_obd ldlm;
                 struct echo_obd echo;
-                struct connmgr_obd mgr;
+                struct recovd_obd recovd;
                 struct trace_obd trace;
+                struct lov_obd lov;
 #if 0
                 struct raid1_obd raid1;
                 struct snap_obd snap;
@@ -178,7 +212,7 @@ struct obd_device {
 };
 
 struct obd_ops {
-        int (*o_iocontrol)(int cmd, struct obd_conn *, int len, void *karg,
+        int (*o_iocontrol)(long cmd, struct obd_conn *, int len, void *karg,
                            void *uarg);
         int (*o_get_info)(struct obd_conn *, obd_count keylen, void *key,
                           obd_count *vallen, void **val);
@@ -190,6 +224,8 @@ struct obd_ops {
         int (*o_cleanup)(struct obd_device *dev);
         int (*o_connect)(struct obd_conn *conn);
         int (*o_disconnect)(struct obd_conn *conn);
+
+
         int (*o_statfs)(struct obd_conn *conn, struct statfs *statfs);
         int (*o_preallocate)(struct obd_conn *, obd_count *req, obd_id *ids);
         int (*o_create)(struct obd_conn *conn,  struct obdo *oa);
@@ -204,7 +240,8 @@ struct obd_ops {
                        obd_size *count, obd_off offset);
         int (*o_brw)(int rw, struct obd_conn *conn, obd_count num_oa,
                      struct obdo **oa, obd_count *oa_bufs, struct page **buf,
-                     obd_size *count, obd_off *offset, obd_flag *flags);
+                     obd_size *count, obd_off *offset, obd_flag *flags,
+                     void *);
         int (*o_punch)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
                        obd_off offset);
         int (*o_sync)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
@@ -218,11 +255,19 @@ struct obd_ops {
                          obd_id *startid, obd_gr group, void *data);
         int (*o_preprw)(int cmd, struct obd_conn *conn,
                         int objcount, struct obd_ioobj *obj,
-                        int niocount, struct niobuf *nb,
-                        struct niobuf *res);
+                        int niocount, struct niobuf_remote *remote,
+                        struct niobuf_local *local, void **desc_private);
         int (*o_commitrw)(int cmd, struct obd_conn *conn,
                           int objcount, struct obd_ioobj *obj,
-                          int niocount, struct niobuf *res);
+                          int niocount, struct niobuf_local *local,
+                          void *desc_private);
+
+        int (*o_enqueue)(struct obd_conn *conn, struct ldlm_namespace *ns,
+                         struct ldlm_handle *parent_lock, __u64 *res_id,
+                         __u32 type, struct ldlm_extent *, __u32 mode,
+                         int *flags, void *data, int datalen,
+                         struct ldlm_handle *lockh);
+        int (*o_cancel)(struct obd_conn *, __u32 mode, struct ldlm_handle *);
 };
 
 #endif