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>
48 * ======== OBD Device Declarations ===========
50 #define MAX_OBD_DEVICES 128
51 extern struct obd_device obd_dev[MAX_OBD_DEVICES];
53 #define OBD_ATTACHED 0x1
54 #define OBD_SET_UP 0x2
56 extern struct proc_dir_entry *
57 proc_lustre_register_obd_device(struct obd_device *obd);
58 extern void proc_lustre_release_obd_device(struct obd_device *obd);
59 extern void proc_lustre_remove_obd_entry(const char* name,
60 struct obd_device *obd);
63 * ======== OBD Operations Declarations ===========
67 static inline int obd_check_conn(struct lustre_handle *conn)
69 struct obd_device *obd;
71 CERROR("NULL conn\n");
74 obd = class_conn2obd(conn);
80 if (!obd->obd_flags & OBD_ATTACHED ) {
81 CERROR("obd %d not attached\n", obd->obd_minor);
85 if (!obd->obd_flags & OBD_SET_UP) {
86 CERROR("obd %d not setup\n", obd->obd_minor);
91 CERROR("obd %d not typed\n", obd->obd_minor);
95 if (!obd->obd_type->typ_ops) {
96 CERROR("obd_check_conn: obd %d no operations\n",
104 #define OBT(dev) (dev)->obd_type
105 #define OBP(dev, op) (dev)->obd_type->typ_ops->o_ ## op
107 #define OBD_CHECK_SETUP(conn, exp) \
110 CERROR("NULL connection\n"); \
114 exp = class_conn2export(conn); \
116 CERROR("No export\n"); \
120 if (!((exp)->exp_obd->obd_flags & OBD_SET_UP)) { \
121 CERROR("Device %d not setup\n", \
122 (exp)->exp_obd->obd_minor); \
127 #define OBD_CHECK_DEVSETUP(obd) \
130 CERROR("NULL device\n"); \
134 if (!((obd)->obd_flags & OBD_SET_UP)) { \
135 CERROR("Device %d not setup\n", \
141 #define OBD_CHECK_OP(obd, op) \
143 if (!OBP((obd), op)) { \
144 CERROR("obd_" #op ": dev %d no operation\n", \
146 RETURN(-EOPNOTSUPP); \
150 static inline int obd_get_info(struct lustre_handle *conn, obd_count keylen,
151 void *key, obd_count *vallen, void **val)
153 struct obd_export *exp;
156 OBD_CHECK_SETUP(conn, exp);
157 OBD_CHECK_OP(exp->exp_obd, get_info);
159 rc = OBP(exp->exp_obd, get_info)(conn, keylen, key, vallen, val);
163 static inline int obd_set_info(struct lustre_handle *conn, obd_count keylen,
164 void *key, obd_count vallen, void *val)
166 struct obd_export *exp;
169 OBD_CHECK_SETUP(conn, exp);
170 OBD_CHECK_OP(exp->exp_obd, set_info);
172 rc = OBP(exp->exp_obd, set_info)(conn, keylen, key, vallen, val);
176 static inline int obd_setup(struct obd_device *obd, int datalen, void *data)
180 OBD_CHECK_OP(obd, setup);
182 rc = OBP(obd, setup)(obd, datalen, data);
186 static inline int obd_cleanup(struct obd_device *obd)
190 OBD_CHECK_DEVSETUP(obd);
191 OBD_CHECK_OP(obd, cleanup);
193 rc = OBP(obd, cleanup)(obd);
197 static inline int obd_create(struct lustre_handle *conn, struct obdo *obdo,
198 struct lov_stripe_md **ea)
200 struct obd_export *exp;
203 OBD_CHECK_SETUP(conn, exp);
204 OBD_CHECK_OP(exp->exp_obd, create);
206 rc = OBP(exp->exp_obd, create)(conn, obdo, ea);
210 static inline int obd_destroy(struct lustre_handle *conn, struct obdo *obdo,
211 struct lov_stripe_md *ea)
213 struct obd_export *exp;
216 OBD_CHECK_SETUP(conn, exp);
217 OBD_CHECK_OP(exp->exp_obd, destroy);
219 rc = OBP(exp->exp_obd, destroy)(conn, obdo, ea);
223 static inline int obd_getattr(struct lustre_handle *conn, struct obdo *obdo,
224 struct lov_stripe_md *ea)
226 struct obd_export *exp;
229 OBD_CHECK_SETUP(conn, exp);
230 OBD_CHECK_OP(exp->exp_obd, getattr);
232 rc = OBP(exp->exp_obd, getattr)(conn, obdo, ea);
236 static inline int obd_close(struct lustre_handle *conn, struct obdo *obdo,
237 struct lov_stripe_md *ea)
239 struct obd_export *exp;
242 OBD_CHECK_SETUP(conn, exp);
243 OBD_CHECK_OP(exp->exp_obd, close);
245 rc = OBP(exp->exp_obd, close)(conn, obdo, ea);
249 static inline int obd_open(struct lustre_handle *conn, struct obdo *obdo,
250 struct lov_stripe_md *ea)
252 struct obd_export *exp;
255 OBD_CHECK_SETUP(conn, exp);
256 OBD_CHECK_OP(exp->exp_obd, open);
258 rc = OBP(exp->exp_obd, open)(conn, obdo, ea);
262 static inline int obd_setattr(struct lustre_handle *conn, struct obdo *obdo,
263 struct lov_stripe_md *ea)
265 struct obd_export *exp;
268 OBD_CHECK_SETUP(conn, exp);
269 OBD_CHECK_OP(exp->exp_obd, setattr);
271 rc = OBP(exp->exp_obd, setattr)(conn, obdo, ea);
275 static inline int obd_connect(struct lustre_handle *conn,
276 struct obd_device *obd, obd_uuid_t cluuid,
277 struct recovd_obd *recovd,
278 ptlrpc_recovery_cb_t recover)
282 OBD_CHECK_DEVSETUP(obd);
283 OBD_CHECK_OP(obd, connect);
285 rc = OBP(obd, connect)(conn, obd, cluuid, recovd, recover);
289 static inline int obd_disconnect(struct lustre_handle *conn)
291 struct obd_export *exp;
294 OBD_CHECK_SETUP(conn, exp);
295 OBD_CHECK_OP(exp->exp_obd, disconnect);
297 rc = OBP(exp->exp_obd, disconnect)(conn);
301 static inline int obd_statfs(struct lustre_handle *conn,struct obd_statfs *osfs)
303 struct obd_export *exp;
306 OBD_CHECK_SETUP(conn, exp);
307 OBD_CHECK_OP(exp->exp_obd, statfs);
309 rc = OBP(exp->exp_obd, statfs)(conn, osfs);
313 static inline int obd_punch(struct lustre_handle *conn, struct obdo *oa,
314 struct lov_stripe_md *ea,
315 obd_size start, obd_size end)
317 struct obd_export *exp;
320 OBD_CHECK_SETUP(conn, exp);
321 OBD_CHECK_OP(exp->exp_obd, punch);
323 rc = OBP(exp->exp_obd, punch)(conn, oa, ea, start, end);
327 static inline int obd_brw(int cmd, struct lustre_handle *conn,
328 struct lov_stripe_md *ea, obd_count oa_bufs,
330 brw_callback_t callback, void *data)
332 struct obd_export *exp;
335 OBD_CHECK_SETUP(conn, exp);
336 OBD_CHECK_OP(exp->exp_obd, brw);
338 if (!(cmd & OBD_BRW_RWMASK)) {
339 CERROR("obd_brw: cmd must be OBD_BRW_READ or OBD_BRW_WRITE\n");
343 rc = OBP(exp->exp_obd, brw)(cmd, conn, ea, oa_bufs, pg, callback, data);
347 static inline int obd_preprw(int cmd, struct lustre_handle *conn,
348 int objcount, struct obd_ioobj *obj,
349 int niocount, struct niobuf_remote *remote,
350 struct niobuf_local *local, void **desc_private)
352 struct obd_export *exp;
355 OBD_CHECK_SETUP(conn, exp);
356 OBD_CHECK_OP(exp->exp_obd, preprw);
358 rc = OBP(exp->exp_obd, preprw)(cmd, conn, objcount, obj, niocount,
359 remote, local, desc_private);
363 static inline int obd_commitrw(int cmd, struct lustre_handle *conn,
364 int objcount, struct obd_ioobj *obj,
365 int niocount, struct niobuf_local *local,
368 struct obd_export *exp;
371 OBD_CHECK_SETUP(conn, exp);
372 OBD_CHECK_OP(exp->exp_obd, commitrw);
374 rc = OBP(exp->exp_obd, commitrw)(cmd, conn, objcount, obj, niocount,
375 local, desc_private);
379 static inline int obd_iocontrol(int cmd, struct lustre_handle *conn,
380 int len, void *karg, void *uarg)
382 struct obd_export *exp;
385 OBD_CHECK_SETUP(conn, exp);
386 OBD_CHECK_OP(exp->exp_obd, iocontrol);
388 rc = OBP(exp->exp_obd, iocontrol)(cmd, conn, len, karg, uarg);
392 static inline int obd_enqueue(struct lustre_handle *conn,
393 struct lov_stripe_md *ea,
394 struct lustre_handle *parent_lock,
395 __u32 type, void *cookie, int cookielen,
396 __u32 mode, int *flags, void *cb, void *data,
397 int datalen, struct lustre_handle *lockh)
399 struct obd_export *exp;
402 OBD_CHECK_SETUP(conn, exp);
403 OBD_CHECK_OP(exp->exp_obd, enqueue);
405 rc = OBP(exp->exp_obd, enqueue)(conn, ea, parent_lock, type,
406 cookie, cookielen, mode, flags, cb,
407 data, datalen, lockh);
411 static inline int obd_cancel(struct lustre_handle *conn,
412 struct lov_stripe_md *ea, __u32 mode,
413 struct lustre_handle *lockh)
415 struct obd_export *exp;
418 OBD_CHECK_SETUP(conn, exp);
419 OBD_CHECK_OP(exp->exp_obd, cancel);
421 rc = OBP(exp->exp_obd, cancel)(conn, ea, mode, lockh);
425 static inline int obd_cancel_unused(struct lustre_handle *conn,
426 struct lov_stripe_md *ea, int local)
428 struct obd_export *exp;
431 OBD_CHECK_SETUP(conn, exp);
432 OBD_CHECK_OP(exp->exp_obd, cancel_unused);
434 rc = OBP(exp->exp_obd, cancel_unused)(conn, ea, local);
441 * ======== OBD Metadata Support ===========
444 extern int obd_init_caches(void);
445 extern void obd_cleanup_caches(void);
447 static inline struct lustre_handle *obdo_handle(struct obdo *oa)
449 return (struct lustre_handle *)&oa->o_inline;
452 static inline void obd_oa2handle(struct lustre_handle *handle, struct obdo *oa)
454 if (oa->o_valid |= OBD_MD_FLHANDLE) {
455 struct lustre_handle *oa_handle = obdo_handle(oa);
456 memcpy(handle, oa_handle, sizeof(*handle));
460 static inline void obd_handle2oa(struct obdo *oa, struct lustre_handle *handle)
463 struct lustre_handle *oa_handle = obdo_handle(oa);
464 memcpy(oa_handle, handle, sizeof(*handle));
465 oa->o_valid |= OBD_MD_FLHANDLE;
470 /* support routines */
471 extern kmem_cache_t *obdo_cachep;
472 static inline struct obdo *obdo_alloc(void)
476 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 void obdo_from_iattr(struct obdo *oa, struct iattr *attr)
493 unsigned int ia_valid = attr->ia_valid;
495 if (ia_valid & ATTR_ATIME) {
496 oa->o_atime = attr->ia_atime;
497 oa->o_valid |= OBD_MD_FLATIME;
499 if (ia_valid & ATTR_MTIME) {
500 oa->o_mtime = attr->ia_mtime;
501 oa->o_valid |= OBD_MD_FLMTIME;
503 if (ia_valid & ATTR_CTIME) {
504 oa->o_ctime = attr->ia_ctime;
505 oa->o_valid |= OBD_MD_FLCTIME;
507 if (ia_valid & ATTR_SIZE) {
508 oa->o_size = attr->ia_size;
509 oa->o_valid |= OBD_MD_FLSIZE;
511 if (ia_valid & ATTR_MODE) {
512 oa->o_mode = attr->ia_mode;
513 oa->o_valid |= OBD_MD_FLTYPE | OBD_MD_FLMODE;
514 if (!in_group_p(oa->o_gid) && !capable(CAP_FSETID))
515 oa->o_mode &= ~S_ISGID;
517 if (ia_valid & ATTR_UID) {
518 oa->o_uid = attr->ia_uid;
519 oa->o_valid |= OBD_MD_FLUID;
521 if (ia_valid & ATTR_GID) {
522 oa->o_gid = attr->ia_gid;
523 oa->o_valid |= OBD_MD_FLGID;
528 static inline void iattr_from_obdo(struct iattr *attr, struct obdo *oa,
531 memset(attr, 0, sizeof(*attr));
532 if (valid & OBD_MD_FLATIME) {
533 attr->ia_atime = oa->o_atime;
534 attr->ia_valid |= ATTR_ATIME;
536 if (valid & OBD_MD_FLMTIME) {
537 attr->ia_mtime = oa->o_mtime;
538 attr->ia_valid |= ATTR_MTIME;
540 if (valid & OBD_MD_FLCTIME) {
541 attr->ia_ctime = oa->o_ctime;
542 attr->ia_valid |= ATTR_CTIME;
544 if (valid & OBD_MD_FLSIZE) {
545 attr->ia_size = oa->o_size;
546 attr->ia_valid |= ATTR_SIZE;
548 if (valid & OBD_MD_FLTYPE) {
549 attr->ia_mode = (attr->ia_mode & ~S_IFMT)|(oa->o_mode & S_IFMT);
550 attr->ia_valid |= ATTR_MODE;
552 if (valid & OBD_MD_FLMODE) {
553 attr->ia_mode = (attr->ia_mode & S_IFMT)|(oa->o_mode & ~S_IFMT);
554 attr->ia_valid |= ATTR_MODE;
555 if (!in_group_p(oa->o_gid) && !capable(CAP_FSETID))
556 attr->ia_mode &= ~S_ISGID;
558 if (valid & OBD_MD_FLUID)
560 attr->ia_uid = oa->o_uid;
561 attr->ia_valid |= ATTR_UID;
563 if (valid & OBD_MD_FLGID) {
564 attr->ia_gid = oa->o_gid;
565 attr->ia_valid |= ATTR_GID;
570 /* WARNING: the file systems must take care not to tinker with
571 attributes they don't manage (such as blocks). */
573 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
574 #define to_kdev_t(dev) dev
575 #define kdev_t_to_nr(dev) dev
578 static inline void obdo_from_inode(struct obdo *dst, struct inode *src,
581 // if (valid & OBD_MD_FLID)
582 // dst->o_id = src->i_ino;
583 if (valid & OBD_MD_FLATIME)
584 dst->o_atime = src->i_atime;
585 if (valid & OBD_MD_FLMTIME)
586 dst->o_mtime = src->i_mtime;
587 if (valid & OBD_MD_FLCTIME)
588 dst->o_ctime = src->i_ctime;
589 if (valid & OBD_MD_FLSIZE)
590 dst->o_size = src->i_size;
591 if (valid & OBD_MD_FLBLOCKS) /* allocation of space */
592 dst->o_blocks = src->i_blocks;
593 if (valid & OBD_MD_FLBLKSZ)
594 dst->o_blksize = src->i_blksize;
595 if (valid & OBD_MD_FLTYPE)
596 dst->o_mode = (dst->o_mode & ~S_IFMT) | (src->i_mode & S_IFMT);
597 if (valid & OBD_MD_FLMODE)
598 dst->o_mode = (dst->o_mode & S_IFMT) | (src->i_mode & ~S_IFMT);
599 if (valid & OBD_MD_FLUID)
600 dst->o_uid = src->i_uid;
601 if (valid & OBD_MD_FLGID)
602 dst->o_gid = src->i_gid;
603 if (valid & OBD_MD_FLFLAGS)
604 dst->o_flags = src->i_flags;
605 if (valid & OBD_MD_FLNLINK)
606 dst->o_nlink = src->i_nlink;
607 if (valid & OBD_MD_FLGENER)
608 dst->o_generation = src->i_generation;
609 if (valid & OBD_MD_FLRDEV)
610 dst->o_rdev = (__u32)kdev_t_to_nr(src->i_rdev);
612 dst->o_valid |= (valid & ~OBD_MD_FLID);
615 static inline void obdo_to_inode(struct inode *dst, struct obdo *src,
618 // if (valid & OBD_MD_FLID)
619 // dst->i_ino = src->o_id;
620 if (valid & OBD_MD_FLATIME)
621 dst->i_atime = src->o_atime;
622 if (valid & OBD_MD_FLMTIME)
623 dst->i_mtime = src->o_mtime;
624 if (valid & OBD_MD_FLCTIME)
625 dst->i_ctime = src->o_ctime;
626 if (valid & OBD_MD_FLSIZE)
627 dst->i_size = src->o_size;
628 if (valid & OBD_MD_FLBLOCKS) /* allocation of space */
629 dst->i_blocks = src->o_blocks;
630 if (valid & OBD_MD_FLBLKSZ)
631 dst->i_blksize = src->o_blksize;
632 if (valid & OBD_MD_FLTYPE)
633 dst->i_mode = (dst->i_mode & ~S_IFMT) | (src->o_mode & S_IFMT);
634 if (valid & OBD_MD_FLMODE)
635 dst->i_mode = (dst->i_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
636 if (valid & OBD_MD_FLUID)
637 dst->i_uid = src->o_uid;
638 if (valid & OBD_MD_FLGID)
639 dst->i_gid = src->o_gid;
640 if (valid & OBD_MD_FLFLAGS)
641 dst->i_flags = src->o_flags;
642 if (valid & OBD_MD_FLNLINK)
643 dst->i_nlink = src->o_nlink;
644 if (valid & OBD_MD_FLGENER)
645 dst->i_generation = src->o_generation;
646 if (valid & OBD_MD_FLRDEV)
647 dst->i_rdev = to_kdev_t(src->o_rdev);
651 static inline void obdo_cpy_md(struct obdo *dst, struct obdo *src,
655 CDEBUG(D_INODE, "src obdo %Ld valid 0x%x, dst obdo %Ld\n",
656 (unsigned long long)src->o_id, src->o_valid,
657 (unsigned long long)dst->o_id);
659 if (valid & OBD_MD_FLATIME)
660 dst->o_atime = src->o_atime;
661 if (valid & OBD_MD_FLMTIME)
662 dst->o_mtime = src->o_mtime;
663 if (valid & OBD_MD_FLCTIME)
664 dst->o_ctime = src->o_ctime;
665 if (valid & OBD_MD_FLSIZE)
666 dst->o_size = src->o_size;
667 if (valid & OBD_MD_FLBLOCKS) /* allocation of space */
668 dst->o_blocks = src->o_blocks;
669 if (valid & OBD_MD_FLBLKSZ)
670 dst->o_blksize = src->o_blksize;
671 if (valid & OBD_MD_FLTYPE)
672 dst->o_mode = (dst->o_mode & ~S_IFMT) | (src->o_mode & S_IFMT);
673 if (valid & OBD_MD_FLMODE)
674 dst->o_mode = (dst->o_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
675 if (valid & OBD_MD_FLUID)
676 dst->o_uid = src->o_uid;
677 if (valid & OBD_MD_FLGID)
678 dst->o_gid = src->o_gid;
679 if (valid & OBD_MD_FLFLAGS)
680 dst->o_flags = src->o_flags;
682 if (valid & OBD_MD_FLOBDFLG)
683 dst->o_obdflags = src->o_obdflags;
685 if (valid & OBD_MD_FLNLINK)
686 dst->o_nlink = src->o_nlink;
687 if (valid & OBD_MD_FLGENER)
688 dst->o_generation = src->o_generation;
689 if (valid & OBD_MD_FLRDEV)
690 dst->o_rdev = src->o_rdev;
691 if (valid & OBD_MD_FLINLINE &&
692 src->o_obdflags & OBD_FL_INLINEDATA) {
693 memcpy(dst->o_inline, src->o_inline, sizeof(src->o_inline));
694 dst->o_obdflags |= OBD_FL_INLINEDATA;
697 dst->o_valid |= valid;
701 /* returns FALSE if comparison (by flags) is same, TRUE if changed */
702 static inline int obdo_cmp_md(struct obdo *dst, struct obdo *src,
707 if ( compare & OBD_MD_FLATIME )
708 res = (res || (dst->o_atime != src->o_atime));
709 if ( compare & OBD_MD_FLMTIME )
710 res = (res || (dst->o_mtime != src->o_mtime));
711 if ( compare & OBD_MD_FLCTIME )
712 res = (res || (dst->o_ctime != src->o_ctime));
713 if ( compare & OBD_MD_FLSIZE )
714 res = (res || (dst->o_size != src->o_size));
715 if ( compare & OBD_MD_FLBLOCKS ) /* allocation of space */
716 res = (res || (dst->o_blocks != src->o_blocks));
717 if ( compare & OBD_MD_FLBLKSZ )
718 res = (res || (dst->o_blksize != src->o_blksize));
719 if ( compare & OBD_MD_FLTYPE )
720 res = (res || (((dst->o_mode ^ src->o_mode) & S_IFMT) != 0));
721 if ( compare & OBD_MD_FLMODE )
722 res = (res || (((dst->o_mode ^ src->o_mode) & ~S_IFMT) != 0));
723 if ( compare & OBD_MD_FLUID )
724 res = (res || (dst->o_uid != src->o_uid));
725 if ( compare & OBD_MD_FLGID )
726 res = (res || (dst->o_gid != src->o_gid));
727 if ( compare & OBD_MD_FLFLAGS )
728 res = (res || (dst->o_flags != src->o_flags));
729 if ( compare & OBD_MD_FLNLINK )
730 res = (res || (dst->o_nlink != src->o_nlink));
731 if ( compare & OBD_MD_FLGENER )
732 res = (res || (dst->o_generation != src->o_generation));
733 /* XXX Don't know if thses should be included here - wasn't previously
734 if ( compare & OBD_MD_FLINLINE )
735 res = (res || memcmp(dst->o_inline, src->o_inline));
742 /* I'm as embarrassed about this as you are.
744 * <shaver> // XXX do not look into _superhack with remaining eye
745 * <shaver> // XXX if this were any uglier, I'd get my own show on MTV */
746 extern int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c);
748 int class_register_type(struct obd_ops *ops, char *nm);
749 int class_unregister_type(char *nm);
750 int class_name2dev(char *name);
751 int class_uuid2dev(char *uuid);
752 struct obd_device *class_uuid2obd(char *uuid);
753 struct obd_export *class_new_export(struct obd_device *obddev);
754 void class_destroy_export(struct obd_export *exp);
755 int class_connect(struct lustre_handle *conn, struct obd_device *obd,
757 int class_disconnect(struct lustre_handle *conn);
758 void class_disconnect_all(struct obd_device *obddev);
760 /* generic operations shared by various OBD types */
761 int class_multi_setup(struct obd_device *obddev, uint32_t len, void *data);
762 int class_multi_cleanup(struct obd_device *obddev);
764 extern void (*class_signal_connection_failure)(struct ptlrpc_connection *);
766 static inline struct ptlrpc_connection *class_rd2conn(struct recovd_data *rd)
768 /* reuse list_entry's member-pointer offset stuff */
769 return list_entry(rd, struct ptlrpc_connection, c_recovd_data);
775 extern void obd_sysctl_init (void);
776 extern void obd_sysctl_clean (void);
779 typedef __u8 class_uuid_t[16];
780 //int class_uuid_parse(obd_uuid_t in, class_uuid_t out);
781 void class_uuid_unparse(class_uuid_t in, obd_uuid_t out);
782 #endif /* __LINUX_CLASS_OBD_H */