Whamcloud - gitweb
* Pass the connecting client's UUID (NB: not the _connection_'s UUID, the
[fs/lustre-release.git] / lustre / include / linux / obd.h
index 2b9c633..ae71fd8 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/fs.h>
 #include <linux/list.h>
 #include <linux/smp_lock.h>
+#include <linux/proc_fs.h>
 
 #include <linux/lustre_idl.h>
 
@@ -22,6 +23,14 @@ struct obd_type {
         int  typ_refcnt;
 };
 
+
+/* Individual type definitions */
+
+struct ext2_obd {
+        struct super_block *e2_sb;
+        struct vfsmount *e2_vfsmnt;
+};
+
 #define OBD_RUN_CTXT_MAGIC      0xC0FFEEAA
 #define OBD_CTXT_DEBUG          /* development-only debugging */
 struct obd_run_ctxt {
@@ -33,22 +42,6 @@ struct obd_run_ctxt {
 #endif
 };
 
-
-
-struct obd_conn {
-        __u64 addr;
-        __u64 cookie;
-        struct obd_device *oc_dev;
-        uint32_t oc_id;
-};
-
-/* Individual type definitions */
-
-struct ext2_obd {
-        struct super_block *e2_sb;
-        struct vfsmount *e2_vfsmnt;
-};
-
 struct filter_obd {
         char *fo_fstype;
         struct super_block *fo_sb;
@@ -63,21 +56,30 @@ struct filter_obd {
         struct address_space_operations *fo_aops;
 };
 
-struct mds_client_info;
 struct mds_server_data;
 
-struct mdc_obd {
-        struct ptlrpc_client *mdc_client;
-        struct ptlrpc_client *mdc_ldlm_client;
-        struct ptlrpc_connection *mdc_conn;
-        __u8 mdc_target_uuid[37];
+struct client_obd {
+        struct ptlrpc_client *cl_client;
+        struct ptlrpc_client *cl_ldlm_client;
+        struct ptlrpc_connection *cl_conn;
+        struct lustre_handle cl_exporth;
+        struct semaphore cl_sem;
+        int cl_conn_count;
+        __u8 cl_target_uuid[37];
+        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 ldlm_namespace *mds_local_namespace;
         struct ptlrpc_service *mds_service;
-        struct ptlrpc_client *mds_ldlm_client; /* to be an LDLM client */
-        struct ptlrpc_connection *mds_ldlm_conn; /* to be an LDLM client */
 
         char *mds_fstype;
         struct super_block *mds_sb;
@@ -88,13 +90,13 @@ struct mds_obd {
         struct inode_operations *mds_iop;
         struct address_space_operations *mds_aops;
         struct mds_fs_operations *mds_fsops;
+        int mds_max_mdsize;
         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;
 };
 
@@ -146,32 +148,35 @@ struct snap_obd {
 
 struct ost_obd {
         struct ptlrpc_service *ost_service;
-        struct obd_conn ost_conn;   /* the local connection to the OBD */
+        struct lustre_handle ost_conn;   /* the local connection to the OBD */
 };
 
-struct osc_obd {
-        struct lustre_handle osc_connh;
-        struct ptlrpc_client *osc_client;
-        struct ptlrpc_client *osc_ldlm_client;
-        struct ptlrpc_connection *osc_conn;
-        __u8 osc_target_uuid[37];
-};
 
-typedef __u8 uuid_t[37];
+struct lov_tgt_desc { 
+        uuid_t uuid;
+        struct lustre_handle conn; 
+};
 
-#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];
+        struct obd_device *mdcobd;
+        struct lov_desc desc;
+        int bufsize; 
+        struct lov_tgt_desc *tgts;
+};
 
-#if 0
-        int lov_count;
-        struct obd_conn *lov_targets;
-#endif
+struct niobuf_local {
+        __u64 offset;
+        __u32 len;
+        __u32 xid;
+        __u32 flags;
+        void *addr;
+        struct page *page;
+        void *target_private;
+        struct dentry *dentry;
 };
 
+#define N_LOCAL_TEMP_PAGE 0x00000001
+
 /* corresponds to one of the obd's */
 struct obd_device {
         struct obd_type *obd_type;
@@ -183,11 +188,6 @@ struct obd_device {
         int obd_minor;
         int obd_flags;
         struct proc_dir_entry *obd_proc_entry;
-        int obd_multi_count;
-        struct obd_conn obd_multi_conn[MAX_MULTI];
-        unsigned int obd_gen_last_id;
-        unsigned long obd_gen_prealloc_quota;
-        //        struct obd_device *obd_target; /* for anything that simply layers */ 
         struct list_head obd_exports;
         struct list_head obd_imports;
         struct ldlm_namespace *obd_namespace;
@@ -195,9 +195,9 @@ struct obd_device {
                 struct ext2_obd ext2;
                 struct filter_obd filter;
                 struct mds_obd mds;
-                struct mdc_obd mdc;
+                struct client_obd cli;
                 struct ost_obd ost;
-                struct osc_obd osc;
+                //                struct osc_obd osc;
                 struct ldlm_obd ldlm;
                 struct echo_obd echo;
                 struct recovd_obd recovd;
@@ -209,58 +209,71 @@ struct obd_device {
         } u;
 };
 
+typedef void (*brw_callback_t)(void *);
+
 struct obd_ops {
-        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,
+        int (*o_iocontrol)(long cmd, struct lustre_handle *, int len,
+                           void *karg, void *uarg);
+        int (*o_get_info)(struct lustre_handle *, obd_count keylen, void *key,
                           obd_count *vallen, void **val);
-        int (*o_set_info)(struct obd_conn *, obd_count keylen, void *key,
+        int (*o_set_info)(struct lustre_handle *, obd_count keylen, void *key,
                           obd_count vallen, void *val);
         int (*o_attach)(struct obd_device *dev, obd_count len, void *data);
         int (*o_detach)(struct obd_device *dev);
         int (*o_setup) (struct obd_device *dev, obd_count len, void *data);
         int (*o_cleanup)(struct obd_device *dev);
-        int (*o_connect)(struct obd_conn *conn, struct obd_device *src);
-        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);
-        int (*o_destroy)(struct obd_conn *conn, struct obdo *oa);
-        int (*o_setattr)(struct obd_conn *conn, struct obdo *oa);
-        int (*o_getattr)(struct obd_conn *conn, struct obdo *oa);
-        int (*o_open)(struct obd_conn *conn, struct obdo *oa);
-        int (*o_close)(struct obd_conn *conn, struct obdo *oa);
-        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,
-                     void *);
-        int (*o_punch)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
+        int (*o_connect)(struct lustre_handle *conn, struct obd_device *src,
+                         char *cluuid);
+        int (*o_disconnect)(struct lustre_handle *conn);
+
+
+        int (*o_statfs)(struct lustre_handle *conn, struct statfs *statfs);
+        int (*o_preallocate)(struct lustre_handle *, obd_count *req,
+                             obd_id *ids);
+        int (*o_create)(struct lustre_handle *conn,  struct obdo *oa,
+                        struct lov_stripe_md **ea);
+        int (*o_destroy)(struct lustre_handle *conn, struct obdo *oa,
+                         struct lov_stripe_md *ea);
+        int (*o_setattr)(struct lustre_handle *conn, struct obdo *oa,
+                         struct lov_stripe_md *ea);
+        int (*o_getattr)(struct lustre_handle *conn, struct obdo *oa,
+                         struct lov_stripe_md *ea);
+        int (*o_open)(struct lustre_handle *conn, struct obdo *oa,
+                      struct lov_stripe_md *);
+        int (*o_close)(struct lustre_handle *conn, struct obdo *oa,
+                       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);
+        int (*o_punch)(struct lustre_handle *conn, struct obdo *tgt,
+                       struct lov_stripe_md *md, obd_size count,
                        obd_off offset);
-        int (*o_sync)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
-                      obd_off offset);
-        int (*o_migrate)(struct obd_conn *conn, struct obdo *dst,
+        int (*o_sync)(struct lustre_handle *conn, struct obdo *tgt,
+                      obd_size count, obd_off offset);
+        int (*o_migrate)(struct lustre_handle *conn, struct obdo *dst,
                          struct obdo *src, obd_size count, obd_off offset);
-        int (*o_copy)(struct obd_conn *dstconn, struct obdo *dst,
-                      struct obd_conn *srconn, struct obdo *src,
+        int (*o_copy)(struct lustre_handle *dstconn, struct obdo *dst,
+                      struct lustre_handle *srconn, struct obdo *src,
                       obd_size count, obd_off offset);
-        int (*o_iterate)(struct obd_conn *conn, int (*)(obd_id, obd_gr, void *),
+        int (*o_iterate)(struct lustre_handle *conn,
+                         int (*)(obd_id, obd_gr, void *),
                          obd_id *startid, obd_gr group, void *data);
-        int (*o_preprw)(int cmd, struct obd_conn *conn,
+        int (*o_preprw)(int cmd, struct lustre_handle *conn,
                         int objcount, struct obd_ioobj *obj,
                         int niocount, struct niobuf_remote *remote,
                         struct niobuf_local *local, void **desc_private);
-        int (*o_commitrw)(int cmd, struct obd_conn *conn,
+        int (*o_commitrw)(int cmd, struct lustre_handle *conn,
                           int objcount, struct obd_ioobj *obj,
                           int niocount, struct niobuf_local *local,
                           void *desc_private);
-        int (*o_enqueue)(struct obd_conn *conn,
+        int (*o_enqueue)(struct lustre_handle *conn,
                          struct lustre_handle *parent_lock, __u64 *res_id,
                          __u32 type, void *cookie, int cookielen, __u32 mode,
                          int *flags, void *cb, void *data, int datalen,
                          struct lustre_handle *lockh);
-        int (*o_cancel)(struct obd_conn *, __u32 mode, struct lustre_handle *);
+        int (*o_cancel)(struct lustre_handle *, __u32 mode,
+                        struct lustre_handle *);
 };
 
 #endif