Whamcloud - gitweb
Fix o_valid and o_size for truncate through osc/ost/filterobd (on HEAD).
[fs/lustre-release.git] / lustre / include / linux / obd.h
index 36f3162..26b07ac 100644 (file)
@@ -26,10 +26,16 @@ struct obd_type {
         int  typ_refcnt;
 };
 
+#define OBD_RUN_CTXT_MAGIC      0xC0FFEEAA
+#define OBD_CTXT_DEBUG          /* development-only debugging */
+
 struct obd_run_ctxt {
         struct vfsmount *pwdmnt;
         struct dentry   *pwd;
         mm_segment_t     fs;
+#ifdef OBD_CTXT_DEBUG
+        __u32            magic;
+#endif
 };
 
 struct obd_conn {
@@ -57,6 +63,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;
@@ -67,11 +75,22 @@ struct filter_obd {
 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 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;
+        struct super_operations *mds_sop;
         struct vfsmount *mds_vfsmnt;
         struct obd_run_ctxt mds_ctxt;
         struct file_operations *mds_fop;
@@ -144,9 +163,8 @@ struct raid1_obd {
 
 struct ost_obd {
         struct ptlrpc_service *ost_service;
-
-        struct obd_device *ost_tgt;
-        struct obd_conn ost_conn;
+        struct obd_device *ost_tgt; /* the exported OBD */ 
+        struct obd_conn ost_conn;   /* the local connection to the OBD */
 };
 
 struct osc_obd {
@@ -154,10 +172,25 @@ struct osc_obd {
         struct ptlrpc_client *osc_client;
         struct ptlrpc_client *osc_ldlm_client;
         struct ptlrpc_connection *osc_conn;
+        __u8 osc_target_uuid[37];
 };
 
-/* 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;
@@ -175,16 +208,19 @@ 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;
                 struct mds_obd mds;
+                struct mdc_obd mdc;
                 struct ost_obd ost;
                 struct osc_obd osc;
                 struct ldlm_obd ldlm;
                 struct echo_obd echo;
                 struct recovd_obd recovd;
                 struct trace_obd trace;
+                struct lov_obd lov;
 #if 0
                 struct raid1_obd raid1;
                 struct snap_obd snap;
@@ -193,7 +229,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);
@@ -221,7 +257,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,
@@ -235,11 +272,18 @@ 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 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 *);
 };
 
 #endif