1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001 Cluster File Systems, Inc.
6 * This code is issued under the GNU General Public License.
7 * See the file COPYING in this distribution
13 #include <linux/list.h>
14 #include <linux/smp_lock.h>
16 #include <linux/lustre_idl.h>
19 struct list_head typ_chain;
20 struct obd_ops *typ_ops;
26 /* Individual type definitions */
29 struct super_block *e2_sb;
30 struct vfsmount *e2_vfsmnt;
33 #define OBD_RUN_CTXT_MAGIC 0xC0FFEEAA
34 #define OBD_CTXT_DEBUG /* development-only debugging */
36 struct vfsmount *pwdmnt;
46 struct super_block *fo_sb;
47 struct vfsmount *fo_vfsmnt;
48 struct obd_run_ctxt fo_ctxt;
49 struct dentry *fo_dentry_O;
50 struct dentry *fo_dentry_O_mode[16];
53 struct file_operations *fo_fop;
54 struct inode_operations *fo_iop;
55 struct address_space_operations *fo_aops;
58 struct mds_client_info;
59 struct mds_server_data;
62 struct lustre_handle mdc_connh;
63 struct ptlrpc_client *mdc_client;
64 struct ptlrpc_client *mdc_ldlm_client;
65 struct ptlrpc_connection *mdc_conn;
66 __u8 mdc_target_uuid[37];
70 struct lustre_handle osc_connh;
71 struct ptlrpc_client *osc_client;
72 struct ptlrpc_client *osc_ldlm_client;
73 struct ptlrpc_connection *osc_conn;
74 __u8 osc_target_uuid[37];
78 struct ldlm_namespace *mds_local_namespace;
79 struct ptlrpc_service *mds_service;
80 struct ptlrpc_client *mds_ldlm_client; /* to be an LDLM client */
81 struct ptlrpc_connection *mds_ldlm_conn; /* to be an LDLM client */
82 struct lustre_handle mds_connh; /* to be one's on DLM client */
85 struct super_block *mds_sb;
86 struct super_operations *mds_sop;
87 struct vfsmount *mds_vfsmnt;
88 struct obd_run_ctxt mds_ctxt;
89 struct file_operations *mds_fop;
90 struct inode_operations *mds_iop;
91 struct address_space_operations *mds_aops;
92 struct mds_fs_operations *mds_fsops;
93 struct file *mds_rcvd_filp;
94 __u64 mds_last_committed;
96 __u64 mds_mount_count;
97 struct ll_fid mds_rootfid;
99 struct list_head mds_client_info;
100 struct mds_server_data *mds_server_data;
104 struct ptlrpc_service *ldlm_service;
105 struct ptlrpc_client *ldlm_client;
106 struct ptlrpc_connection *ldlm_server_conn;
111 struct super_block *eo_sb;
112 struct vfsmount *eo_vfsmnt;
113 struct obd_run_ctxt eo_ctxt;
116 struct file_operations *eo_fop;
117 struct inode_operations *eo_iop;
118 struct address_space_operations *eo_aops;
122 time_t recovd_waketime;
123 time_t recovd_timeout;
124 struct ptlrpc_service *recovd_service;
125 struct ptlrpc_client *recovd_client;
127 __u32 recovd_wakeup_flag;
128 spinlock_t recovd_lock;
129 struct list_head recovd_clients_lh; /* clients managed */
130 struct list_head recovd_troubled_lh; /* clients in trouble */
131 wait_queue_head_t recovd_recovery_waitq;
132 wait_queue_head_t recovd_ctl_waitq;
133 wait_queue_head_t recovd_waitq;
134 struct task_struct *recovd_thread;
138 struct obdtrace_opstats *stats;
143 unsigned int snap_index; /* which snapshot index are we accessing */
150 struct ptlrpc_service *ost_service;
151 struct lustre_handle ost_conn; /* the local connection to the OBD */
155 struct lov_tgt_desc {
157 struct lustre_handle conn;
161 struct obd_device *mdcobd;
162 struct lov_desc desc;
164 struct lov_tgt_desc *tgts;
167 /* corresponds to one of the obd's */
169 struct obd_type *obd_type;
171 /* common and UUID name of this device */
177 struct proc_dir_entry *obd_proc_entry;
178 struct list_head obd_exports;
179 struct list_head obd_imports;
180 struct ldlm_namespace *obd_namespace;
182 struct ext2_obd ext2;
183 struct filter_obd filter;
188 struct ldlm_obd ldlm;
189 struct echo_obd echo;
190 struct recovd_obd recovd;
191 struct trace_obd trace;
194 struct snap_obd snap;
200 int (*o_iocontrol)(long cmd, struct lustre_handle *, int len, void *karg,
202 int (*o_get_info)(struct lustre_handle *, obd_count keylen, void *key,
203 obd_count *vallen, void **val);
204 int (*o_set_info)(struct lustre_handle *, obd_count keylen, void *key,
205 obd_count vallen, void *val);
206 int (*o_attach)(struct obd_device *dev, obd_count len, void *data);
207 int (*o_detach)(struct obd_device *dev);
208 int (*o_setup) (struct obd_device *dev, obd_count len, void *data);
209 int (*o_cleanup)(struct obd_device *dev);
210 int (*o_connect)(struct lustre_handle *conn, struct obd_device *src);
211 int (*o_disconnect)(struct lustre_handle *conn);
214 int (*o_statfs)(struct lustre_handle *conn, struct statfs *statfs);
215 int (*o_preallocate)(struct lustre_handle *, obd_count *req, obd_id *ids);
216 int (*o_create)(struct lustre_handle *conn, struct obdo *oa);
217 int (*o_destroy)(struct lustre_handle *conn, struct obdo *oa);
218 int (*o_setattr)(struct lustre_handle *conn, struct obdo *oa);
219 int (*o_getattr)(struct lustre_handle *conn, struct obdo *oa);
220 int (*o_open)(struct lustre_handle *conn, struct obdo *oa);
221 int (*o_close)(struct lustre_handle *conn, struct obdo *oa);
222 int (*o_brw)(int rw, struct lustre_handle *conn, obd_count num_oa,
223 struct obdo **oa, obd_count *oa_bufs, struct page **buf,
224 obd_size *count, obd_off *offset, obd_flag *flags,
226 int (*o_punch)(struct lustre_handle *conn, struct obdo *tgt, obd_size count,
228 int (*o_sync)(struct lustre_handle *conn, struct obdo *tgt, obd_size count,
230 int (*o_migrate)(struct lustre_handle *conn, struct obdo *dst,
231 struct obdo *src, obd_size count, obd_off offset);
232 int (*o_copy)(struct lustre_handle *dstconn, struct obdo *dst,
233 struct lustre_handle *srconn, struct obdo *src,
234 obd_size count, obd_off offset);
235 int (*o_iterate)(struct lustre_handle *conn, int (*)(obd_id, obd_gr, void *),
236 obd_id *startid, obd_gr group, void *data);
237 int (*o_preprw)(int cmd, struct lustre_handle *conn,
238 int objcount, struct obd_ioobj *obj,
239 int niocount, struct niobuf_remote *remote,
240 struct niobuf_local *local, void **desc_private);
241 int (*o_commitrw)(int cmd, struct lustre_handle *conn,
242 int objcount, struct obd_ioobj *obj,
243 int niocount, struct niobuf_local *local,
245 int (*o_enqueue)(struct lustre_handle *conn,
246 struct lustre_handle *parent_lock, __u64 *res_id,
247 __u32 type, void *cookie, int cookielen, __u32 mode,
248 int *flags, void *cb, void *data, int datalen,
249 struct lustre_handle *lockh);
250 int (*o_cancel)(struct lustre_handle *, __u32 mode, struct lustre_handle *);