1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef __LINUX_CLASS_OBD_H
24 #define __LINUX_CLASS_OBD_H
29 #include <linux/list.h>
32 #include <asm/segment.h>
33 #include <asm/uaccess.h>
34 #include <linux/types.h>
36 #include <linux/time.h>
38 #include <linux/lustre_lib.h>
39 #include <linux/lustre_idl.h>
40 #include <linux/obd.h>
44 * ======== OBD Device Declarations ===========
46 #define MAX_OBD_DEVICES 8
48 extern struct obd_device obd_dev[MAX_OBD_DEVICES];
50 #define OBD_ATTACHED 0x1
51 #define OBD_SET_UP 0x2
54 struct obd_device *oc_dev;
58 #include <linux/lustre_net.h>
63 struct dentry *dentry; /* file system obd device names */
64 __u8 _uuid[16]; /* uuid obd device names */
67 #include <linux/obd_ext2.h>
68 #include <linux/obd_filter.h>
69 #include <linux/lustre_mds.h>
70 #include <linux/lustre_net.h>
71 #include <linux/lustre_dlm.h>
72 #include <linux/obd_snap.h>
73 #include <linux/obd_trace.h>
74 /* #include <linux/obd_fc.h> */
75 #include <linux/obd_raid1.h>
76 #include <linux/obd_ost.h>
77 #include <linux/obd_osc.h>
80 /* corresponds to one of the obd's */
82 struct obd_type *obd_type;
86 obd_devicename obd_fsname;
87 struct proc_dir_entry *obd_proc_entry;
89 struct obd_conn obd_multi_conn[MAX_MULTI];
90 unsigned int obd_gen_last_id;
91 unsigned long obd_gen_prealloc_quota;
92 struct list_head obd_gen_clients;
93 struct list_head obd_req_list;
94 wait_queue_head_t obd_req_waitq;
97 struct filter_obd filter;
99 struct raid1_obd raid1;
100 struct snap_obd snap;
101 struct trace_obd trace;
104 struct ldlm_obd ldlm;
108 extern struct proc_dir_entry *proc_lustre_register_obd_device(struct obd_device *obd);
109 extern void proc_lustre_release_obd_device(struct obd_device *obd);
110 extern void proc_lustre_remove_obd_entry(const char* name, struct obd_device *obd);
113 * ======== OBD Operations Declarations ===========
116 #define OBD_BRW_READ 1
117 #define OBD_BRW_WRITE 2
118 #define OBD_BRW_RWMASK OBD_BRW_READ | OBD_BRW_WRITE
119 #define OBD_BRW_CREATE 4
122 int (*o_iocontrol)(int cmd, struct obd_conn *, int len, void *karg,
124 int (*o_get_info)(struct obd_conn *, obd_count keylen, void *key,
125 obd_count *vallen, void **val);
126 int (*o_set_info)(struct obd_conn *, obd_count keylen, void *key,
127 obd_count vallen, void *val);
128 int (*o_attach)(struct obd_device *dev, obd_count len, void *data);
129 int (*o_detach)(struct obd_device *dev);
130 int (*o_setup) (struct obd_device *dev, obd_count len, void *data);
131 int (*o_cleanup)(struct obd_device *dev);
132 int (*o_connect)(struct obd_conn *conn);
133 int (*o_disconnect)(struct obd_conn *conn);
134 int (*o_statfs)(struct obd_conn *conn, struct statfs *statfs);
135 int (*o_preallocate)(struct obd_conn *, obd_count *req, obd_id *ids);
136 int (*o_create)(struct obd_conn *conn, struct obdo *oa);
137 int (*o_destroy)(struct obd_conn *conn, struct obdo *oa);
138 int (*o_setattr)(struct obd_conn *conn, struct obdo *oa);
139 int (*o_getattr)(struct obd_conn *conn, struct obdo *oa);
140 int (*o_open)(struct obd_conn *conn, struct obdo *oa);
141 int (*o_close)(struct obd_conn *conn, struct obdo *oa);
142 int (*o_read)(struct obd_conn *conn, struct obdo *oa, char *buf,
143 obd_size *count, obd_off offset);
144 int (*o_write)(struct obd_conn *conn, struct obdo *oa, char *buf,
145 obd_size *count, obd_off offset);
146 int (*o_brw)(int rw, struct obd_conn *conn, obd_count num_oa,
147 struct obdo **oa, obd_count *oa_bufs, struct page **buf,
148 obd_size *count, obd_off *offset, obd_flag *flags);
149 int (*o_punch)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
151 int (*o_sync)(struct obd_conn *conn, struct obdo *tgt, obd_size count,
153 int (*o_migrate)(struct obd_conn *conn, struct obdo *dst,
154 struct obdo *src, obd_size count, obd_off offset);
155 int (*o_copy)(struct obd_conn *dstconn, struct obdo *dst,
156 struct obd_conn *srconn, struct obdo *src,
157 obd_size count, obd_off offset);
158 int (*o_iterate)(struct obd_conn *conn, int (*)(obd_id, obd_gr, void *),
159 obd_id *startid, obd_gr group, void *data);
160 int (*o_preprw)(int cmd, struct obd_conn *conn,
161 int objcount, struct obd_ioobj *obj,
162 int niocount, struct niobuf *nb,
164 int (*o_commitrw)(int cmd, struct obd_conn *conn,
165 int objcount, struct obd_ioobj *obj,
166 int niocount, struct niobuf *res);
171 struct obd_conn *conn;
176 static inline int obd_check_conn(struct obd_conn *conn)
178 struct obd_device *obd;
180 printk("obd_check_conn: NULL conn\n");
185 printk("obd_check_conn: NULL obd\n");
189 if (!obd->obd_flags & OBD_ATTACHED ) {
190 printk("obd_check_conn: obd %d not attached\n", obd->obd_minor);
194 if (!obd->obd_flags & OBD_SET_UP) {
195 printk("obd_check_conn: obd %d not setup\n", obd->obd_minor);
199 if (!obd->obd_type) {
200 printk("obd_check_conn: obd %d not typed\n", obd->obd_minor);
204 if (!obd->obd_type->typ_ops) {
205 printk("obd_check_conn: obd %d no operations\n", obd->obd_minor);
211 #define OBT(dev) dev->obd_type
212 #define OBP(dev,op) dev->obd_type->typ_ops->o_ ## op
214 #define OBD_CHECK_SETUP(conn) \
217 CERROR("NULL connection\n"); \
221 if (!((conn)->oc_dev)) { \
222 CERROR("NULL device\n"); \
226 if ( !((conn)->oc_dev->obd_flags & OBD_SET_UP) ) { \
227 CERROR("Device %d not setup\n", (conn)->oc_dev->obd_minor); \
232 #define OBD_CHECK_OP(conn,op) \
234 int rc = obd_check_conn(conn); \
236 printk("obd: error in operation: " #op "\n"); \
239 if (!OBP(conn->oc_dev,op)) { \
240 printk("obd_" #op ": dev %d no operation\n", \
241 conn->oc_dev->obd_minor); \
242 return -EOPNOTSUPP; \
246 static inline int obd_get_info(struct obd_conn *conn, obd_count keylen, void *key,
247 obd_count *vallen, void **val)
250 OBD_CHECK_SETUP(conn);
251 OBD_CHECK_OP(conn,get_info);
253 rc = OBP(conn->oc_dev, get_info)(conn, keylen, key, vallen, val);
258 static inline int obd_set_info(struct obd_conn *conn, obd_count keylen, void *key,
259 obd_count vallen, void *val)
262 OBD_CHECK_SETUP(conn);
263 OBD_CHECK_OP(conn,set_info);
265 rc = OBP(conn->oc_dev, set_info)(conn, keylen, key, vallen, val);
270 static inline int obd_setup(struct obd_device *obd, int datalen, void *data)
272 struct obd_conn conn;
276 OBD_CHECK_OP((&conn),setup);
278 rc = OBP(conn.oc_dev, setup)(obd, datalen, data);
283 static inline int obd_cleanup(struct obd_device *obd)
285 struct obd_conn conn;
289 OBD_CHECK_SETUP(&conn);
290 OBD_CHECK_OP((&conn),cleanup);
292 rc = OBP(conn.oc_dev, cleanup)(obd);
297 static inline int obd_create(struct obd_conn *conn, struct obdo *obdo)
300 OBD_CHECK_SETUP(conn);
301 OBD_CHECK_OP(conn,create);
303 rc = OBP(conn->oc_dev, create)(conn, obdo);
308 static inline int obd_destroy(struct obd_conn *conn, struct obdo *obdo)
311 OBD_CHECK_SETUP(conn);
312 OBD_CHECK_OP(conn,destroy);
314 rc = OBP(conn->oc_dev, destroy)(conn, obdo);
319 static inline int obd_getattr(struct obd_conn *conn, struct obdo *obdo)
322 OBD_CHECK_SETUP(conn);
323 OBD_CHECK_OP(conn,getattr);
325 rc = OBP(conn->oc_dev, getattr)(conn, obdo);
330 static inline int obd_close(struct obd_conn *conn, struct obdo *obdo)
333 OBD_CHECK_SETUP(conn);
334 OBD_CHECK_OP(conn,close);
336 rc = OBP(conn->oc_dev, close)(conn, obdo);
340 static inline int obd_open(struct obd_conn *conn, struct obdo *obdo)
343 OBD_CHECK_SETUP(conn);
344 OBD_CHECK_OP(conn,open);
346 rc = OBP(conn->oc_dev, open) (conn, obdo);
351 static inline int obd_setattr(struct obd_conn *conn, struct obdo *obdo)
354 OBD_CHECK_SETUP(conn);
355 OBD_CHECK_OP(conn,setattr);
357 rc = OBP(conn->oc_dev, setattr)(conn, obdo);
362 static inline int obd_connect(struct obd_conn *conn)
365 OBD_CHECK_SETUP(conn);
366 OBD_CHECK_OP(conn,connect);
368 rc = OBP(conn->oc_dev, connect)(conn);
373 static inline int obd_disconnect(struct obd_conn *conn)
376 OBD_CHECK_SETUP(conn);
377 OBD_CHECK_OP(conn,disconnect);
379 rc = OBP(conn->oc_dev, disconnect)(conn);
384 static inline int obd_statfs(struct obd_conn *conn, struct statfs *buf)
387 OBD_CHECK_SETUP(conn);
388 OBD_CHECK_OP(conn,statfs);
390 rc = OBP(conn->oc_dev, statfs)(conn, buf);
395 static inline int obd_punch(struct obd_conn *conn, struct obdo *tgt, obd_size count, obd_off offset)
398 OBD_CHECK_SETUP(conn);
399 OBD_CHECK_OP(conn,punch);
401 rc = OBP(conn->oc_dev, punch)(conn, tgt, count, offset);
406 static inline int obd_brw(int rw, struct obd_conn *conn, obd_count num_oa,
407 struct obdo **oa, obd_count *oa_bufs, struct page **buf,
408 obd_size *count, obd_off *offset, obd_flag *flags)
411 OBD_CHECK_SETUP(conn);
412 OBD_CHECK_OP(conn,brw);
414 rc = OBP(conn->oc_dev, brw)(rw, conn, num_oa, oa, oa_bufs, buf,
415 count, offset, flags);
420 static inline int obd_preprw(int cmd, struct obd_conn *conn,
421 int objcount, struct obd_ioobj *obj,
422 int niocount, struct niobuf *nb,
426 OBD_CHECK_SETUP(conn);
427 OBD_CHECK_OP(conn, preprw);
429 rc = OBP(conn->oc_dev, preprw)(cmd, conn, objcount, obj, niocount, nb, res);
434 static inline int obd_commitrw(int cmd, struct obd_conn *conn,
435 int objcount, struct obd_ioobj *obj,
436 int niocount, struct niobuf *res)
439 OBD_CHECK_SETUP(conn);
440 OBD_CHECK_OP(conn, commitrw);
442 rc = OBP(conn->oc_dev, commitrw)(cmd, conn, objcount, obj, niocount, res);
451 * ======== OBD Metadata Support ===========
454 extern int obd_init_obdo_cache(void);
455 extern void obd_cleanup_obdo_cache(void);
458 static inline int obdo_has_inline(struct obdo *obdo)
460 return (obdo->o_valid & OBD_MD_FLINLINE &&
461 obdo->o_obdflags & OBD_FL_INLINEDATA);
464 static inline int obdo_has_obdmd(struct obdo *obdo)
466 return (obdo->o_valid & OBD_MD_FLOBDMD &&
467 obdo->o_obdflags & OBD_FL_OBDMDEXISTS);
471 /* support routines */
472 extern kmem_cache_t *obdo_cachep;
474 static __inline__ struct obdo *obdo_alloc(void)
476 struct obdo *oa = NULL;
478 oa = kmem_cache_alloc(obdo_cachep, SLAB_KERNEL);
479 memset(oa, 0, sizeof (*oa));
484 static __inline__ void obdo_free(struct obdo *oa)
488 kmem_cache_free(obdo_cachep, oa);
491 static __inline__ struct obdo *obdo_fromid(struct obd_conn *conn, obd_id id,
492 obd_mode mode, obd_flag valid)
501 return ERR_PTR(-ENOMEM);
507 if ((err = OBP(conn->oc_dev, getattr)(conn, oa))) {
516 static inline void obdo_from_iattr(struct obdo *oa, struct iattr *attr)
518 unsigned int ia_valid = attr->ia_valid;
520 if (ia_valid & ATTR_ATIME) {
521 oa->o_atime = attr->ia_atime;
522 oa->o_valid |= OBD_MD_FLATIME;
524 if (ia_valid & ATTR_MTIME) {
525 oa->o_mtime = attr->ia_mtime;
526 oa->o_valid |= OBD_MD_FLMTIME;
528 if (ia_valid & ATTR_CTIME) {
529 oa->o_ctime = attr->ia_ctime;
530 oa->o_valid |= OBD_MD_FLCTIME;
532 if (ia_valid & ATTR_SIZE) {
533 oa->o_size = attr->ia_size;
534 oa->o_valid |= OBD_MD_FLSIZE;
536 if (ia_valid & ATTR_MODE) {
537 oa->o_mode = attr->ia_mode;
538 oa->o_valid |= OBD_MD_FLMODE;
539 if (!in_group_p(oa->o_gid) && !capable(CAP_FSETID))
540 oa->o_mode &= ~S_ISGID;
542 if (ia_valid & ATTR_UID)
544 oa->o_uid = attr->ia_uid;
545 oa->o_valid |= OBD_MD_FLUID;
547 if (ia_valid & ATTR_GID) {
548 oa->o_gid = attr->ia_gid;
549 oa->o_valid |= OBD_MD_FLGID;
554 static inline void iattr_from_obdo(struct iattr *attr, struct obdo *oa)
556 unsigned int ia_valid = oa->o_valid;
558 memset(attr, 0, sizeof(*attr));
559 if (ia_valid & OBD_MD_FLATIME) {
560 attr->ia_atime = oa->o_atime;
561 attr->ia_valid |= ATTR_ATIME;
563 if (ia_valid & OBD_MD_FLMTIME) {
564 attr->ia_mtime = oa->o_mtime;
565 attr->ia_valid |= ATTR_MTIME;
567 if (ia_valid & OBD_MD_FLCTIME) {
568 attr->ia_ctime = oa->o_ctime;
569 attr->ia_valid |= ATTR_CTIME;
571 if (ia_valid & OBD_MD_FLSIZE) {
572 attr->ia_size = oa->o_size;
573 attr->ia_valid |= ATTR_SIZE;
575 if (ia_valid & OBD_MD_FLMODE) {
576 attr->ia_mode = oa->o_mode;
577 attr->ia_valid |= ATTR_MODE;
578 if (!in_group_p(oa->o_gid) && !capable(CAP_FSETID))
579 attr->ia_mode &= ~S_ISGID;
581 if (ia_valid & OBD_MD_FLUID)
583 attr->ia_uid = oa->o_uid;
584 attr->ia_valid |= ATTR_UID;
586 if (ia_valid & OBD_MD_FLGID) {
587 attr->ia_gid = oa->o_gid;
588 attr->ia_valid |= ATTR_GID;
593 /* WARNING: the file systems must take care not to tinker with
594 attributes they don't manage (such as blocks). */
596 static __inline__ void obdo_from_inode(struct obdo *dst, struct inode *src)
598 if ( dst->o_valid & OBD_MD_FLID )
599 dst->o_id = src->i_ino;
600 if ( dst->o_valid & OBD_MD_FLATIME )
601 dst->o_atime = src->i_atime;
602 if ( dst->o_valid & OBD_MD_FLMTIME )
603 dst->o_mtime = src->i_mtime;
604 if ( dst->o_valid & OBD_MD_FLCTIME )
605 dst->o_ctime = src->i_ctime;
606 if ( dst->o_valid & OBD_MD_FLSIZE )
607 dst->o_size = src->i_size;
608 if ( dst->o_valid & OBD_MD_FLBLOCKS ) /* allocation of space */
609 dst->o_blocks = src->i_blocks;
610 if ( dst->o_valid & OBD_MD_FLBLKSZ )
611 dst->o_blksize = src->i_blksize;
612 if ( dst->o_valid & OBD_MD_FLMODE )
613 dst->o_mode = src->i_mode;
614 if ( dst->o_valid & OBD_MD_FLUID )
615 dst->o_uid = src->i_uid;
616 if ( dst->o_valid & OBD_MD_FLGID )
617 dst->o_gid = src->i_gid;
618 if ( dst->o_valid & OBD_MD_FLFLAGS )
619 dst->o_flags = src->i_flags;
620 if ( dst->o_valid & OBD_MD_FLNLINK )
621 dst->o_nlink = src->i_nlink;
622 if ( dst->o_valid & OBD_MD_FLGENER )
623 dst->o_generation = src->i_generation;
626 static __inline__ void obdo_to_inode(struct inode *dst, struct obdo *src)
629 if ( src->o_valid & OBD_MD_FLID )
630 dst->i_ino = src->o_id;
631 if ( src->o_valid & OBD_MD_FLATIME )
632 dst->i_atime = src->o_atime;
633 if ( src->o_valid & OBD_MD_FLMTIME )
634 dst->i_mtime = src->o_mtime;
635 if ( src->o_valid & OBD_MD_FLCTIME )
636 dst->i_ctime = src->o_ctime;
637 if ( src->o_valid & OBD_MD_FLSIZE )
638 dst->i_size = src->o_size;
639 if ( src->o_valid & OBD_MD_FLBLOCKS ) /* allocation of space */
640 dst->i_blocks = src->o_blocks;
641 if ( src->o_valid & OBD_MD_FLBLKSZ )
642 dst->i_blksize = src->o_blksize;
643 if ( src->o_valid & OBD_MD_FLMODE )
644 dst->i_mode = src->o_mode;
645 if ( src->o_valid & OBD_MD_FLUID )
646 dst->i_uid = src->o_uid;
647 if ( src->o_valid & OBD_MD_FLGID )
648 dst->i_gid = src->o_gid;
649 if ( src->o_valid & OBD_MD_FLFLAGS )
650 dst->i_flags = src->o_flags;
651 if ( src->o_valid & OBD_MD_FLNLINK )
652 dst->i_nlink = src->o_nlink;
653 if ( src->o_valid & OBD_MD_FLGENER )
654 dst->i_generation = src->o_generation;
659 static __inline__ void obdo_cpy_md(struct obdo *dst, struct obdo *src)
662 CDEBUG(D_INODE, "src obdo %Ld valid 0x%x, dst obdo %Ld\n",
663 src->o_id, src->o_valid, dst->o_id);
665 if ( src->o_valid & OBD_MD_FLATIME )
666 dst->o_atime = src->o_atime;
667 if ( src->o_valid & OBD_MD_FLMTIME )
668 dst->o_mtime = src->o_mtime;
669 if ( src->o_valid & OBD_MD_FLCTIME )
670 dst->o_ctime = src->o_ctime;
671 if ( src->o_valid & OBD_MD_FLSIZE )
672 dst->o_size = src->o_size;
673 if ( src->o_valid & OBD_MD_FLBLOCKS ) /* allocation of space */
674 dst->o_blocks = src->o_blocks;
675 if ( src->o_valid & OBD_MD_FLBLKSZ )
676 dst->o_blksize = src->o_blksize;
677 if ( src->o_valid & OBD_MD_FLMODE )
678 dst->o_mode = src->o_mode;
679 if ( src->o_valid & OBD_MD_FLUID )
680 dst->o_uid = src->o_uid;
681 if ( src->o_valid & OBD_MD_FLGID )
682 dst->o_gid = src->o_gid;
683 if ( src->o_valid & OBD_MD_FLFLAGS )
684 dst->o_flags = src->o_flags;
686 if ( src->o_valid & OBD_MD_FLOBDFLG )
687 dst->o_obdflags = src->o_obdflags;
689 if ( src->o_valid & OBD_MD_FLNLINK )
690 dst->o_nlink = src->o_nlink;
691 if ( src->o_valid & OBD_MD_FLGENER )
692 dst->o_generation = src->o_generation;
693 if ( src->o_valid & OBD_MD_FLINLINE &&
694 src->o_obdflags & OBD_FL_INLINEDATA) {
695 memcpy(dst->o_inline, src->o_inline, sizeof(src->o_inline));
696 dst->o_obdflags |= OBD_FL_INLINEDATA;
698 if ( src->o_valid & OBD_MD_FLOBDMD &&
699 src->o_obdflags & OBD_FL_OBDMDEXISTS) {
700 memcpy(dst->o_obdmd, src->o_obdmd, sizeof(src->o_obdmd));
701 dst->o_obdflags |= OBD_FL_OBDMDEXISTS;
704 dst->o_valid |= src->o_valid;
708 /* returns FALSE if comparison (by flags) is same, TRUE if changed */
709 static __inline__ int obdo_cmp_md(struct obdo *dst, struct obdo *src,
714 if ( compare & OBD_MD_FLATIME )
715 res = (res || (dst->o_atime != src->o_atime));
716 if ( compare & OBD_MD_FLMTIME )
717 res = (res || (dst->o_mtime != src->o_mtime));
718 if ( compare & OBD_MD_FLCTIME )
719 res = (res || (dst->o_ctime != src->o_ctime));
720 if ( compare & OBD_MD_FLSIZE )
721 res = (res || (dst->o_size != src->o_size));
722 if ( compare & OBD_MD_FLBLOCKS ) /* allocation of space */
723 res = (res || (dst->o_blocks != src->o_blocks));
724 if ( compare & OBD_MD_FLBLKSZ )
725 res = (res || (dst->o_blksize != src->o_blksize));
726 if ( compare & OBD_MD_FLMODE )
727 res = (res || (dst->o_mode != src->o_mode));
728 if ( compare & OBD_MD_FLUID )
729 res = (res || (dst->o_uid != src->o_uid));
730 if ( compare & OBD_MD_FLGID )
731 res = (res || (dst->o_gid != src->o_gid));
732 if ( compare & OBD_MD_FLFLAGS )
733 res = (res || (dst->o_flags != src->o_flags));
734 if ( compare & OBD_MD_FLNLINK )
735 res = (res || (dst->o_nlink != src->o_nlink));
736 if ( compare & OBD_MD_FLGENER )
737 res = (res || (dst->o_generation != src->o_generation));
738 /* XXX Don't know if thses should be included here - wasn't previously
739 if ( compare & OBD_MD_FLINLINE )
740 res = (res || memcmp(dst->o_inline, src->o_inline));
741 if ( compare & OBD_MD_FLOBDMD )
742 res = (res || memcmp(dst->o_obdmd, src->o_obdmd));
749 int obd_register_type(struct obd_ops *ops, char *nm);
750 int obd_unregister_type(char *nm);
753 struct list_head cli_chain;
754 struct obd_device *cli_obd;
756 unsigned long cli_prealloc_quota;
757 struct list_head cli_prealloc_inodes;
761 struct obd_prealloc_inode {
762 struct list_head obd_prealloc_chain;
766 /* generic operations shared by various OBD types */
767 int gen_multi_setup(struct obd_device *obddev, uint32_t len, void *data);
768 int gen_multi_cleanup(struct obd_device *obddev);
769 int gen_multi_attach(struct obd_device *obddev, uint32_t len, void *data);
770 int gen_multi_detach(struct obd_device *obddev);
771 int gen_connect (struct obd_conn *conn);
772 int gen_disconnect(struct obd_conn *conn);
773 struct obd_client *gen_client(const struct obd_conn *);
774 int gen_cleanup(struct obd_device *obddev);
775 int gen_copy_data(struct obd_conn *dst_conn, struct obdo *dst,
776 struct obd_conn *src_conn, struct obdo *src,
777 obd_size count, obd_off offset);
782 extern void obd_sysctl_init (void);
783 extern void obd_sysctl_clean (void);
785 #endif /* __LINUX_CLASS_OBD_H */