X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdclass%2Fgenops.c;h=fcc57a5fe10ead74ad28ed89312f279b216c1759;hp=f188f7471b2bf895fdf20c6a846f1c5cbbff2779;hb=400b0681017091fab9cef9bd00e0f536e1793dcc;hpb=c3b5a88ed42538afd3db8d67cb5171546174eefa diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index f188f74..fcc57a5 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -18,6 +18,7 @@ #include #include #include +#include extern struct list_head obd_types; kmem_cache_t *obdo_cachep = NULL; @@ -148,9 +149,10 @@ struct obd_type *class_nm_to_type(char *nm) return type; } -int class_register_type(struct obd_ops *ops, char *nm) +int class_register_type(struct obd_ops *ops, struct lprocfs_vars* vars, char *nm) { struct obd_type *type; + int rc; ENTRY; @@ -171,6 +173,10 @@ int class_register_type(struct obd_ops *ops, char *nm) list_add(&type->typ_chain, &obd_types); memcpy(type->typ_ops, ops, sizeof(*type->typ_ops)); strcpy(type->typ_name, nm); + rc = lprocfs_reg_class(type, (lprocfs_vars_t *)vars, (void*)type); + if(rc) + RETURN(rc); + RETURN(0); } @@ -192,6 +198,8 @@ int class_unregister_type(char *nm) OBD_FREE(type->typ_ops, sizeof(*type->typ_ops)); RETURN(-EBUSY); } + if(type->typ_procroot) + lprocfs_dereg_class(type); list_del(&type->typ_chain); OBD_FREE(type->typ_name, strlen(nm) + 1);