X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdecho%2Fecho.c;h=f31068771dc8826a1556c62c595288118a69d6ef;hp=2b09d957dbab3092371c1ad6c78fc0e5e09bc9ce;hb=400b0681017091fab9cef9bd00e0f536e1793dcc;hpb=c3b5a88ed42538afd3db8d67cb5171546174eefa;ds=sidebyside diff --git a/lustre/obdecho/echo.c b/lustre/obdecho/echo.c index 2b09d95..f310687 100644 --- a/lustre/obdecho/echo.c +++ b/lustre/obdecho/echo.c @@ -12,8 +12,8 @@ * and Andreas Dilger */ -static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.41 2002/10/18 22:32:45 pschwan Exp $"; -#define OBDECHO_VERSION "$Revision: 1.41 $" +static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.42 2002/11/01 17:23:13 thantry Exp $"; +#define OBDECHO_VERSION "$Revision: 1.42 $" #define EXPORT_SYMTAB @@ -38,6 +38,7 @@ static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.41 2002/10/18 22:3 #include #include #include +#include static atomic_t echo_page_rws; static atomic_t echo_getattrs; @@ -45,6 +46,9 @@ static atomic_t echo_getattrs; #define ECHO_PROC_STAT "sys/obdecho" #define ECHO_INIT_OBJID 0x1000000000000000ULL +extern lprocfs_vars_t status_var_nm_1[]; +extern lprocfs_vars_t status_class_var[]; + int echo_proc_read(char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -425,7 +429,26 @@ static int echo_cleanup(struct obd_device *obddev) RETURN(0); } +int echo_attach(struct obd_device *dev, + obd_count len, void *data) +{ + int rc; + rc = lprocfs_reg_obd(dev, (lprocfs_vars_t*)status_var_nm_1, (void*)dev); + return rc; +} + +int echo_detach(struct obd_device *dev) +{ + int rc; + rc = lprocfs_dereg_obd(dev); + return rc; + +} + + struct obd_ops echo_obd_ops = { + o_attach: echo_attach, + o_detach: echo_detach, o_connect: echo_connect, o_disconnect: echo_disconnect, o_create: echo_create, @@ -442,16 +465,25 @@ struct obd_ops echo_obd_ops = { static int __init obdecho_init(void) { + int rc; + + printk(KERN_INFO "Echo OBD driver " OBDECHO_VERSION " info@clusterfs.com\n"); echo_proc_init(); + rc = class_register_type(&echo_obd_ops, + (lprocfs_vars_t*)status_class_var, + OBD_ECHO_DEVICENAME); + if (rc) RETURN(rc); + + return 0; - return class_register_type(&echo_obd_ops, OBD_ECHO_DEVICENAME); } static void __exit obdecho_exit(void) { + echo_proc_fini(); class_unregister_type(OBD_ECHO_DEVICENAME);