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/obd_support.h>
39 #include <linux/obd.h>
40 #include <linux/lustre_lib.h>
41 #include <linux/lustre_idl.h>
42 #include <linux/lustre_mds.h>
43 #include <linux/lustre_dlm.h>
44 #include <linux/lprocfs_status.h>
49 * ======== OBD Device Declarations ===========
51 #define MAX_OBD_DEVICES 128
52 extern struct obd_device obd_dev[MAX_OBD_DEVICES];
54 #define OBD_ATTACHED 0x1
55 #define OBD_SET_UP 0x2
57 extern struct proc_dir_entry *
58 proc_lustre_register_obd_device(struct obd_device *obd);
59 extern void proc_lustre_release_obd_device(struct obd_device *obd);
60 extern void proc_lustre_remove_obd_entry(const char* name,
61 struct obd_device *obd);
64 * ======== OBD Operations Declarations ===========
68 static inline int obd_check_conn(struct lustre_handle *conn)
70 struct obd_device *obd;
72 CERROR("NULL conn\n");
75 obd = class_conn2obd(conn);
81 if (!obd->obd_flags & OBD_ATTACHED ) {
82 CERROR("obd %d not attached\n", obd->obd_minor);
86 if (!obd->obd_flags & OBD_SET_UP) {
87 CERROR("obd %d not setup\n", obd->obd_minor);
92 CERROR("obd %d not typed\n", obd->obd_minor);
96 if (!obd->obd_type->typ_ops) {
97 CERROR("obd_check_conn: obd %d no operations\n",
105 #define OBT(dev) (dev)->obd_type
106 #define OBP(dev, op) (dev)->obd_type->typ_ops->o_ ## op
108 #define OBD_CHECK_SETUP(conn, exp) \
111 CERROR("NULL connection\n"); \
115 exp = class_conn2export(conn); \
117 CERROR("No export\n"); \
121 if (!((exp)->exp_obd->obd_flags & OBD_SET_UP)) { \
122 CERROR("Device %d not setup\n", \
123 (exp)->exp_obd->obd_minor); \
128 #define OBD_CHECK_DEVSETUP(obd) \
131 CERROR("NULL device\n"); \
135 if (!((obd)->obd_flags & OBD_SET_UP)) { \
136 CERROR("Device %d not setup\n", \
142 #define OBD_CHECK_OP(obd, op) \
144 if (!OBP((obd), op)) { \
145 CERROR("obd_" #op ": dev %d no operation\n", \
147 RETURN(-EOPNOTSUPP); \
151 static inline int obd_get_info(struct lustre_handle *conn, obd_count keylen,
152 void *key, obd_count *vallen, void **val)
154 struct obd_export *exp;
157 OBD_CHECK_SETUP(conn, exp);
158 OBD_CHECK_OP(exp->exp_obd, get_info);
160 rc = OBP(exp->exp_obd, get_info)(conn, keylen, key, vallen, val);
164 static inline int obd_set_info(struct lustre_handle *conn, obd_count keylen,
165 void *key, obd_count vallen, void *val)
167 struct obd_export *exp;
170 OBD_CHECK_SETUP(conn, exp);
171 OBD_CHECK_OP(exp->exp_obd, set_info);
173 rc = OBP(exp->exp_obd, set_info)(conn, keylen, key, vallen, val);
177 static inline int obd_setup(struct obd_device *obd, int datalen, void *data)
181 OBD_CHECK_OP(obd, setup);
183 rc = OBP(obd, setup)(obd, datalen, data);
187 static inline int obd_cleanup(struct obd_device *obd)
191 OBD_CHECK_DEVSETUP(obd);
192 OBD_CHECK_OP(obd, cleanup);
194 rc = OBP(obd, cleanup)(obd);
198 static inline int obd_create(struct lustre_handle *conn, struct obdo *obdo,
199 struct lov_stripe_md **ea)
201 struct obd_export *exp;
204 OBD_CHECK_SETUP(conn, exp);
205 OBD_CHECK_OP(exp->exp_obd, create);
207 rc = OBP(exp->exp_obd, create)(conn, obdo, ea);
211 static inline int obd_destroy(struct lustre_handle *conn, struct obdo *obdo,
212 struct lov_stripe_md *ea)
214 struct obd_export *exp;
217 OBD_CHECK_SETUP(conn, exp);
218 OBD_CHECK_OP(exp->exp_obd, destroy);
220 rc = OBP(exp->exp_obd, destroy)(conn, obdo, ea);
224 static inline int obd_getattr(struct lustre_handle *conn, struct obdo *obdo,
225 struct lov_stripe_md *ea)
227 struct obd_export *exp;
230 OBD_CHECK_SETUP(conn, exp);
231 OBD_CHECK_OP(exp->exp_obd, getattr);
233 rc = OBP(exp->exp_obd, getattr)(conn, obdo, ea);
237 static inline int obd_close(struct lustre_handle *conn, struct obdo *obdo,
238 struct lov_stripe_md *ea)
240 struct obd_export *exp;
243 OBD_CHECK_SETUP(conn, exp);
244 OBD_CHECK_OP(exp->exp_obd, close);
246 rc = OBP(exp->exp_obd, close)(conn, obdo, ea);
250 static inline int obd_open(struct lustre_handle *conn, struct obdo *obdo,
251 struct lov_stripe_md *ea)
253 struct obd_export *exp;
256 OBD_CHECK_SETUP(conn, exp);
257 OBD_CHECK_OP(exp->exp_obd, open);
259 rc = OBP(exp->exp_obd, open)(conn, obdo, ea);
263 static inline int obd_setattr(struct lustre_handle *conn, struct obdo *obdo,
264 struct lov_stripe_md *ea)
266 struct obd_export *exp;
269 OBD_CHECK_SETUP(conn, exp);
270 OBD_CHECK_OP(exp->exp_obd, setattr);
272 rc = OBP(exp->exp_obd, setattr)(conn, obdo, ea);
276 static inline int obd_connect(struct lustre_handle *conn,
277 struct obd_device *obd, obd_uuid_t cluuid,
278 struct recovd_obd *recovd,
279 ptlrpc_recovery_cb_t recover)
283 OBD_CHECK_DEVSETUP(obd);
284 OBD_CHECK_OP(obd, connect);
286 rc = OBP(obd, connect)(conn, obd, cluuid, recovd, recover);
290 static inline int obd_disconnect(struct lustre_handle *conn)
292 struct obd_export *exp;
295 OBD_CHECK_SETUP(conn, exp);
296 OBD_CHECK_OP(exp->exp_obd, disconnect);
298 rc = OBP(exp->exp_obd, disconnect)(conn);
302 static inline int obd_statfs(struct lustre_handle *conn,struct obd_statfs *osfs)
304 struct obd_export *exp;
307 OBD_CHECK_SETUP(conn, exp);
308 OBD_CHECK_OP(exp->exp_obd, statfs);
310 rc = OBP(exp->exp_obd, statfs)(conn, osfs);
314 static inline int obd_punch(struct lustre_handle *conn, struct obdo *oa,
315 struct lov_stripe_md *ea,
316 obd_size start, obd_size end)
318 struct obd_export *exp;
321 OBD_CHECK_SETUP(conn, exp);
322 OBD_CHECK_OP(exp->exp_obd, punch);
324 rc = OBP(exp->exp_obd, punch)(conn, oa, ea, start, end);
328 static inline int obd_brw(int cmd, struct lustre_handle *conn,
329 struct lov_stripe_md *ea, obd_count oa_bufs,
331 brw_callback_t callback, void *data)
333 struct obd_export *exp;
336 OBD_CHECK_SETUP(conn, exp);
337 OBD_CHECK_OP(exp->exp_obd, brw);
339 if (!(cmd & OBD_BRW_RWMASK)) {
340 CERROR("obd_brw: cmd must be OBD_BRW_READ or OBD_BRW_WRITE\n");
344 rc = OBP(exp->exp_obd, brw)(cmd, conn, ea, oa_bufs, pg, callback, data);
348 static inline int obd_preprw(int cmd, struct lustre_handle *conn,
349 int objcount, struct obd_ioobj *obj,
350 int niocount, struct niobuf_remote *remote,
351 struct niobuf_local *local, void **desc_private)
353 struct obd_export *exp;
356 OBD_CHECK_SETUP(conn, exp);
357 OBD_CHECK_OP(exp->exp_obd, preprw);
359 rc = OBP(exp->exp_obd, preprw)(cmd, conn, objcount, obj, niocount,
360 remote, local, desc_private);
364 static inline int obd_commitrw(int cmd, struct lustre_handle *conn,
365 int objcount, struct obd_ioobj *obj,
366 int niocount, struct niobuf_local *local,
369 struct obd_export *exp;
372 OBD_CHECK_SETUP(conn, exp);
373 OBD_CHECK_OP(exp->exp_obd, commitrw);
375 rc = OBP(exp->exp_obd, commitrw)(cmd, conn, objcount, obj, niocount,
376 local, desc_private);
380 static inline int obd_iocontrol(int cmd, struct lustre_handle *conn,
381 int len, void *karg, void *uarg)
383 struct obd_export *exp;
386 OBD_CHECK_SETUP(conn, exp);
387 OBD_CHECK_OP(exp->exp_obd, iocontrol);
389 rc = OBP(exp->exp_obd, iocontrol)(cmd, conn, len, karg, uarg);
393 static inline int obd_enqueue(struct lustre_handle *conn,
394 struct lov_stripe_md *ea,
395 struct lustre_handle *parent_lock,
396 __u32 type, void *cookie, int cookielen,
397 __u32 mode, int *flags, void *cb, void *data,
398 int datalen, struct lustre_handle *lockh)
400 struct obd_export *exp;
403 OBD_CHECK_SETUP(conn, exp);
404 OBD_CHECK_OP(exp->exp_obd, enqueue);
406 rc = OBP(exp->exp_obd, enqueue)(conn, ea, parent_lock, type,
407 cookie, cookielen, mode, flags, cb,
408 data, datalen, lockh);
412 static inline int obd_cancel(struct lustre_handle *conn,
413 struct lov_stripe_md *ea, __u32 mode,
414 struct lustre_handle *lockh)
416 struct obd_export *exp;
419 OBD_CHECK_SETUP(conn, exp);
420 OBD_CHECK_OP(exp->exp_obd, cancel);
422 rc = OBP(exp->exp_obd, cancel)(conn, ea, mode, lockh);
426 static inline int obd_cancel_unused(struct lustre_handle *conn,
427 struct lov_stripe_md *ea, int local)
429 struct obd_export *exp;
432 OBD_CHECK_SETUP(conn, exp);
433 OBD_CHECK_OP(exp->exp_obd, cancel_unused);
435 rc = OBP(exp->exp_obd, cancel_unused)(conn, ea, local);
442 * ======== OBD Metadata Support ===========
445 extern int obd_init_caches(void);
446 extern void obd_cleanup_caches(void);
448 static inline struct lustre_handle *obdo_handle(struct obdo *oa)
450 return (struct lustre_handle *)&oa->o_inline;
453 static inline void obd_oa2handle(struct lustre_handle *handle, struct obdo *oa)
455 if (oa->o_valid |= OBD_MD_FLHANDLE) {
456 struct lustre_handle *oa_handle = obdo_handle(oa);
457 memcpy(handle, oa_handle, sizeof(*handle));
461 static inline void obd_handle2oa(struct obdo *oa, struct lustre_handle *handle)
464 struct lustre_handle *oa_handle = obdo_handle(oa);
465 memcpy(oa_handle, handle, sizeof(*handle));
466 oa->o_valid |= OBD_MD_FLHANDLE;
471 /* support routines */
472 extern kmem_cache_t *obdo_cachep;
473 static inline struct obdo *obdo_alloc(void)
477 oa = kmem_cache_alloc(obdo_cachep, SLAB_KERNEL);
480 memset(oa, 0, sizeof (*oa));
485 static inline void obdo_free(struct obdo *oa)
489 kmem_cache_free(obdo_cachep, oa);
492 static inline void obdo_from_iattr(struct obdo *oa, struct iattr *attr)
494 unsigned int ia_valid = attr->ia_valid;
496 if (ia_valid & ATTR_ATIME) {
497 oa->o_atime = attr->ia_atime;
498 oa->o_valid |= OBD_MD_FLATIME;
500 if (ia_valid & ATTR_MTIME) {
501 oa->o_mtime = attr->ia_mtime;
502 oa->o_valid |= OBD_MD_FLMTIME;
504 if (ia_valid & ATTR_CTIME) {
505 oa->o_ctime = attr->ia_ctime;
506 oa->o_valid |= OBD_MD_FLCTIME;
508 if (ia_valid & ATTR_SIZE) {
509 oa->o_size = attr->ia_size;
510 oa->o_valid |= OBD_MD_FLSIZE;
512 if (ia_valid & ATTR_MODE) {
513 oa->o_mode = attr->ia_mode;
514 oa->o_valid |= OBD_MD_FLTYPE | OBD_MD_FLMODE;
515 if (!in_group_p(oa->o_gid) && !capable(CAP_FSETID))
516 oa->o_mode &= ~S_ISGID;
518 if (ia_valid & ATTR_UID) {
519 oa->o_uid = attr->ia_uid;
520 oa->o_valid |= OBD_MD_FLUID;
522 if (ia_valid & ATTR_GID) {
523 oa->o_gid = attr->ia_gid;
524 oa->o_valid |= OBD_MD_FLGID;
529 static inline void iattr_from_obdo(struct iattr *attr, struct obdo *oa,
532 memset(attr, 0, sizeof(*attr));
533 if (valid & OBD_MD_FLATIME) {
534 attr->ia_atime = oa->o_atime;
535 attr->ia_valid |= ATTR_ATIME;
537 if (valid & OBD_MD_FLMTIME) {
538 attr->ia_mtime = oa->o_mtime;
539 attr->ia_valid |= ATTR_MTIME;
541 if (valid & OBD_MD_FLCTIME) {
542 attr->ia_ctime = oa->o_ctime;
543 attr->ia_valid |= ATTR_CTIME;
545 if (valid & OBD_MD_FLSIZE) {
546 attr->ia_size = oa->o_size;
547 attr->ia_valid |= ATTR_SIZE;
549 if (valid & OBD_MD_FLTYPE) {
550 attr->ia_mode = (attr->ia_mode & ~S_IFMT)|(oa->o_mode & S_IFMT);
551 attr->ia_valid |= ATTR_MODE;
553 if (valid & OBD_MD_FLMODE) {
554 attr->ia_mode = (attr->ia_mode & S_IFMT)|(oa->o_mode & ~S_IFMT);
555 attr->ia_valid |= ATTR_MODE;
556 if (!in_group_p(oa->o_gid) && !capable(CAP_FSETID))
557 attr->ia_mode &= ~S_ISGID;
559 if (valid & OBD_MD_FLUID)
561 attr->ia_uid = oa->o_uid;
562 attr->ia_valid |= ATTR_UID;
564 if (valid & OBD_MD_FLGID) {
565 attr->ia_gid = oa->o_gid;
566 attr->ia_valid |= ATTR_GID;
571 /* WARNING: the file systems must take care not to tinker with
572 attributes they don't manage (such as blocks). */
574 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
575 #define to_kdev_t(dev) dev
576 #define kdev_t_to_nr(dev) dev
579 static inline void obdo_from_inode(struct obdo *dst, struct inode *src,
582 // if (valid & OBD_MD_FLID)
583 // dst->o_id = src->i_ino;
584 if (valid & OBD_MD_FLATIME)
585 dst->o_atime = src->i_atime;
586 if (valid & OBD_MD_FLMTIME)
587 dst->o_mtime = src->i_mtime;
588 if (valid & OBD_MD_FLCTIME)
589 dst->o_ctime = src->i_ctime;
590 if (valid & OBD_MD_FLSIZE)
591 dst->o_size = src->i_size;
592 if (valid & OBD_MD_FLBLOCKS) /* allocation of space */
593 dst->o_blocks = src->i_blocks;
594 if (valid & OBD_MD_FLBLKSZ)
595 dst->o_blksize = src->i_blksize;
596 if (valid & OBD_MD_FLTYPE)
597 dst->o_mode = (dst->o_mode & ~S_IFMT) | (src->i_mode & S_IFMT);
598 if (valid & OBD_MD_FLMODE)
599 dst->o_mode = (dst->o_mode & S_IFMT) | (src->i_mode & ~S_IFMT);
600 if (valid & OBD_MD_FLUID)
601 dst->o_uid = src->i_uid;
602 if (valid & OBD_MD_FLGID)
603 dst->o_gid = src->i_gid;
604 if (valid & OBD_MD_FLFLAGS)
605 dst->o_flags = src->i_flags;
606 if (valid & OBD_MD_FLNLINK)
607 dst->o_nlink = src->i_nlink;
608 if (valid & OBD_MD_FLGENER)
609 dst->o_generation = src->i_generation;
610 if (valid & OBD_MD_FLRDEV)
611 dst->o_rdev = (__u32)kdev_t_to_nr(src->i_rdev);
613 dst->o_valid |= (valid & ~OBD_MD_FLID);
616 static inline void obdo_to_inode(struct inode *dst, struct obdo *src,
619 // if (valid & OBD_MD_FLID)
620 // dst->i_ino = src->o_id;
621 if (valid & OBD_MD_FLATIME)
622 dst->i_atime = src->o_atime;
623 if (valid & OBD_MD_FLMTIME)
624 dst->i_mtime = src->o_mtime;
625 if (valid & OBD_MD_FLCTIME)
626 dst->i_ctime = src->o_ctime;
627 if (valid & OBD_MD_FLSIZE)
628 dst->i_size = src->o_size;
629 if (valid & OBD_MD_FLBLOCKS) /* allocation of space */
630 dst->i_blocks = src->o_blocks;
631 if (valid & OBD_MD_FLBLKSZ)
632 dst->i_blksize = src->o_blksize;
633 if (valid & OBD_MD_FLTYPE)
634 dst->i_mode = (dst->i_mode & ~S_IFMT) | (src->o_mode & S_IFMT);
635 if (valid & OBD_MD_FLMODE)
636 dst->i_mode = (dst->i_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
637 if (valid & OBD_MD_FLUID)
638 dst->i_uid = src->o_uid;
639 if (valid & OBD_MD_FLGID)
640 dst->i_gid = src->o_gid;
641 if (valid & OBD_MD_FLFLAGS)
642 dst->i_flags = src->o_flags;
643 if (valid & OBD_MD_FLNLINK)
644 dst->i_nlink = src->o_nlink;
645 if (valid & OBD_MD_FLGENER)
646 dst->i_generation = src->o_generation;
647 if (valid & OBD_MD_FLRDEV)
648 dst->i_rdev = to_kdev_t(src->o_rdev);
652 static inline void obdo_cpy_md(struct obdo *dst, struct obdo *src,
656 CDEBUG(D_INODE, "src obdo %Ld valid 0x%x, dst obdo %Ld\n",
657 (unsigned long long)src->o_id, src->o_valid,
658 (unsigned long long)dst->o_id);
660 if (valid & OBD_MD_FLATIME)
661 dst->o_atime = src->o_atime;
662 if (valid & OBD_MD_FLMTIME)
663 dst->o_mtime = src->o_mtime;
664 if (valid & OBD_MD_FLCTIME)
665 dst->o_ctime = src->o_ctime;
666 if (valid & OBD_MD_FLSIZE)
667 dst->o_size = src->o_size;
668 if (valid & OBD_MD_FLBLOCKS) /* allocation of space */
669 dst->o_blocks = src->o_blocks;
670 if (valid & OBD_MD_FLBLKSZ)
671 dst->o_blksize = src->o_blksize;
672 if (valid & OBD_MD_FLTYPE)
673 dst->o_mode = (dst->o_mode & ~S_IFMT) | (src->o_mode & S_IFMT);
674 if (valid & OBD_MD_FLMODE)
675 dst->o_mode = (dst->o_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
676 if (valid & OBD_MD_FLUID)
677 dst->o_uid = src->o_uid;
678 if (valid & OBD_MD_FLGID)
679 dst->o_gid = src->o_gid;
680 if (valid & OBD_MD_FLFLAGS)
681 dst->o_flags = src->o_flags;
683 if (valid & OBD_MD_FLOBDFLG)
684 dst->o_obdflags = src->o_obdflags;
686 if (valid & OBD_MD_FLNLINK)
687 dst->o_nlink = src->o_nlink;
688 if (valid & OBD_MD_FLGENER)
689 dst->o_generation = src->o_generation;
690 if (valid & OBD_MD_FLRDEV)
691 dst->o_rdev = src->o_rdev;
692 if (valid & OBD_MD_FLINLINE &&
693 src->o_obdflags & OBD_FL_INLINEDATA) {
694 memcpy(dst->o_inline, src->o_inline, sizeof(src->o_inline));
695 dst->o_obdflags |= OBD_FL_INLINEDATA;
698 dst->o_valid |= valid;
702 /* returns FALSE if comparison (by flags) is same, TRUE if changed */
703 static inline int obdo_cmp_md(struct obdo *dst, struct obdo *src,
708 if ( compare & OBD_MD_FLATIME )
709 res = (res || (dst->o_atime != src->o_atime));
710 if ( compare & OBD_MD_FLMTIME )
711 res = (res || (dst->o_mtime != src->o_mtime));
712 if ( compare & OBD_MD_FLCTIME )
713 res = (res || (dst->o_ctime != src->o_ctime));
714 if ( compare & OBD_MD_FLSIZE )
715 res = (res || (dst->o_size != src->o_size));
716 if ( compare & OBD_MD_FLBLOCKS ) /* allocation of space */
717 res = (res || (dst->o_blocks != src->o_blocks));
718 if ( compare & OBD_MD_FLBLKSZ )
719 res = (res || (dst->o_blksize != src->o_blksize));
720 if ( compare & OBD_MD_FLTYPE )
721 res = (res || (((dst->o_mode ^ src->o_mode) & S_IFMT) != 0));
722 if ( compare & OBD_MD_FLMODE )
723 res = (res || (((dst->o_mode ^ src->o_mode) & ~S_IFMT) != 0));
724 if ( compare & OBD_MD_FLUID )
725 res = (res || (dst->o_uid != src->o_uid));
726 if ( compare & OBD_MD_FLGID )
727 res = (res || (dst->o_gid != src->o_gid));
728 if ( compare & OBD_MD_FLFLAGS )
729 res = (res || (dst->o_flags != src->o_flags));
730 if ( compare & OBD_MD_FLNLINK )
731 res = (res || (dst->o_nlink != src->o_nlink));
732 if ( compare & OBD_MD_FLGENER )
733 res = (res || (dst->o_generation != src->o_generation));
734 /* XXX Don't know if thses should be included here - wasn't previously
735 if ( compare & OBD_MD_FLINLINE )
736 res = (res || memcmp(dst->o_inline, src->o_inline));
743 /* I'm as embarrassed about this as you are.
745 * <shaver> // XXX do not look into _superhack with remaining eye
746 * <shaver> // XXX if this were any uglier, I'd get my own show on MTV */
747 extern int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c);
749 int class_register_type(struct obd_ops *ops, lprocfs_vars_t* vars, char *nm);
750 int class_unregister_type(char *nm);
751 int class_name2dev(char *name);
752 int class_uuid2dev(char *uuid);
753 struct obd_device *class_uuid2obd(char *uuid);
754 struct obd_export *class_new_export(struct obd_device *obddev);
755 struct obd_type *class_nm_to_type(char* name);
756 void class_destroy_export(struct obd_export *exp);
757 int class_connect(struct lustre_handle *conn, struct obd_device *obd,
759 int class_disconnect(struct lustre_handle *conn);
760 void class_disconnect_all(struct obd_device *obddev);
762 /* generic operations shared by various OBD types */
763 int class_multi_setup(struct obd_device *obddev, uint32_t len, void *data);
764 int class_multi_cleanup(struct obd_device *obddev);
766 extern void (*class_signal_connection_failure)(struct ptlrpc_connection *);
768 static inline struct ptlrpc_connection *class_rd2conn(struct recovd_data *rd)
770 /* reuse list_entry's member-pointer offset stuff */
771 return list_entry(rd, struct ptlrpc_connection, c_recovd_data);
777 extern void obd_sysctl_init (void);
778 extern void obd_sysctl_clean (void);
781 typedef __u8 class_uuid_t[16];
782 //int class_uuid_parse(obd_uuid_t in, class_uuid_t out);
783 void class_uuid_unparse(class_uuid_t in, obd_uuid_t out);
784 #endif /* __LINUX_CLASS_OBD_H */