#include <linux/obd_class.h>
#include <linux/random.h>
#include <linux/slab.h>
+#include <linux/lprocfs_status.h>
extern struct list_head obd_types;
kmem_cache_t *obdo_cachep = NULL;
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;
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);
}
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);