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>
18 struct obd_conn_info {
19 unsigned int conn_id; /* handle */
23 struct list_head typ_chain;
24 struct obd_ops *typ_ops;
30 struct vfsmount *pwdmnt;
36 struct obd_device *oc_dev;
40 struct obd_devicename {
43 struct dentry *dentry; /* file system obd device names */
44 __u8 _uuid[16]; /* uuid obd device names */
48 /* Individual type definitions */
51 struct super_block *e2_sb;
52 struct vfsmount *e2_vfsmnt;
57 struct super_block *fo_sb;
58 struct vfsmount *fo_vfsmnt;
59 struct obd_run_ctxt fo_ctxt;
62 struct file_operations *fo_fop;
63 struct inode_operations *fo_iop;
64 struct address_space_operations *fo_aops;
68 struct ptlrpc_service *mds_service;
71 struct super_block *mds_sb;
72 struct vfsmount *mds_vfsmnt;
73 struct obd_run_ctxt mds_ctxt;
74 struct file_operations *mds_fop;
75 struct inode_operations *mds_iop;
76 struct address_space_operations *mds_aops;
77 struct mds_fs_operations *mds_fsops;
81 struct ptlrpc_service *ldlm_service;
82 struct ptlrpc_client *ldlm_client;
83 struct lustre_peer ldlm_server_peer;
85 struct list_head ldlm_namespaces;
91 struct super_block *eo_sb;
92 struct vfsmount *eo_vfsmnt;
93 struct obd_run_ctxt eo_ctxt;
96 struct file_operations *eo_fop;
97 struct inode_operations *eo_iop;
98 struct address_space_operations *eo_aops;
102 struct obdtrace_opstats *stats;
107 unsigned int snap_index; /* which snapshot index are we accessing */
112 unsigned int raid1_count; /* how many replicas */
113 /* devices to replicate on */
114 struct obd_device *raid1_devlist[MAX_RAID1];
115 /* connections we make */
116 struct obd_conn_info raid1_connections[MAX_RAID1];
117 struct list_head raid1_clients; /* clients we have */
122 struct ptlrpc_service *ost_service;
124 struct obd_device *ost_tgt;
125 struct obd_conn ost_conn;
129 struct obd_device *osc_tgt;
130 struct ptlrpc_client *osc_client;
131 struct lustre_peer osc_peer;
134 /* corresponds to one of the obd's */
137 struct obd_type *obd_type;
141 struct obd_devicename obd_fsname;
142 struct proc_dir_entry *obd_proc_entry;
144 struct obd_conn obd_multi_conn[MAX_MULTI];
145 unsigned int obd_gen_last_id;
146 unsigned long obd_gen_prealloc_quota;
147 struct list_head obd_gen_clients;
148 struct list_head obd_req_list;
149 wait_queue_head_t obd_req_waitq;
151 struct ext2_obd ext2;
152 struct filter_obd filter;
156 struct ldlm_obd ldlm;
157 struct echo_obd echo;
158 struct trace_obd trace;
160 struct raid1_obd raid1;
161 struct snap_obd snap;
167 int (*o_iocontrol)(int cmd, struct obd_conn *, int len, void *karg,
169 int (*o_get_info)(struct obd_conn *, obd_count keylen, void *key,
170 obd_count *vallen, void **val);
171 int (*o_set_info)(struct obd_conn *, obd_count keylen, void *key,
172 obd_count vallen, void *val);
173 int (*o_attach)(struct obd_device *dev, obd_count len, void *data);
174 int (*o_detach)(struct obd_device *dev);
175 int (*o_setup) (struct obd_device *dev, obd_count len, void *data);
176 int (*o_cleanup)(struct obd_device *dev);
177 int (*o_connect)(struct obd_conn *conn);
178 int (*o_disconnect)(struct obd_conn *conn);
179 int (*o_statfs)(struct obd_conn *conn, struct statfs *statfs);
180 int (*o_preallocate)(struct obd_conn *, obd_count *req, obd_id *ids);
181 int (*o_create)(struct obd_conn *conn, struct obdo *oa);
182 int (*o_destroy)(struct obd_conn *conn, struct obdo *oa);
183 int (*o_setattr)(struct obd_conn *conn, struct obdo *oa);
184 int (*o_getattr)(struct obd_conn *conn, struct obdo *oa);
185 int (*o_open)(struct obd_conn *conn, struct obdo *oa);
186 int (*o_close)(struct obd_conn *conn, struct obdo *oa);
187 int (*o_read)(struct obd_conn *conn, struct obdo *oa, char *buf,
188 obd_size *count, obd_off offset);
189 int (*o_write)(struct obd_conn *conn, struct obdo *oa, char *buf,
190 obd_size *count, obd_off offset);
191 int (*o_brw)(int rw, struct obd_conn *conn, obd_count num_oa,
192 struct obdo **oa, obd_count *oa_bufs, struct page **buf,
193 obd_size *count, obd_off *offset, obd_flag *flags);
194 int (*o_punch)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
196 int (*o_sync)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
198 int (*o_migrate)(struct obd_conn *conn, struct obdo *dst,
199 struct obdo *src, obd_size count, obd_off offset);
200 int (*o_copy)(struct obd_conn *dstconn, struct obdo *dst,
201 struct obd_conn *srconn, struct obdo *src,
202 obd_size count, obd_off offset);
203 int (*o_iterate)(struct obd_conn *conn, int (*)(obd_id, obd_gr, void *),
204 obd_id *startid, obd_gr group, void *data);
205 int (*o_preprw)(int cmd, struct obd_conn *conn,
206 int objcount, struct obd_ioobj *obj,
207 int niocount, struct niobuf *nb,
209 int (*o_commitrw)(int cmd, struct obd_conn *conn,
210 int objcount, struct obd_ioobj *obj,
211 int niocount, struct niobuf *res);