return count;
}
+/* Root for /sys/kernel/debug/lustre */
+struct dentry *debugfs_lustre_root;
+EXPORT_SYMBOL_GPL(debugfs_lustre_root);
+
#ifdef CONFIG_PROC_FS
/* Root for /proc/fs/lustre */
struct proc_dir_entry *proc_lustre_root = NULL;
return rc;
seq = file->private_data;
- seq->private = PDE_DATA(inode);
+ seq->private = inode->i_private;
return 0;
}
int class_procfs_init(void)
{
struct proc_dir_entry *entry;
+ struct dentry *file;
int rc = 0;
ENTRY;
obd_sysctl_init();
+ debugfs_lustre_root = debugfs_create_dir("lustre", NULL);
+ if (IS_ERR_OR_NULL(debugfs_lustre_root)) {
+ rc = debugfs_lustre_root ? PTR_ERR(debugfs_lustre_root)
+ : -ENOMEM;
+ debugfs_lustre_root = NULL;
+ kobject_put(lustre_kobj);
+ goto out;
+ }
+
+ file = debugfs_create_file("devices", 0444, debugfs_lustre_root, NULL,
+ &obd_device_list_fops);
+ if (IS_ERR_OR_NULL(file)) {
+ rc = file ? PTR_ERR(file) : -ENOMEM;
+ kobject_put(lustre_kobj);
+ goto out;
+ }
+
entry = lprocfs_register("fs/lustre", NULL, NULL, NULL);
if (IS_ERR(entry)) {
rc = PTR_ERR(entry);
}
proc_lustre_root = entry;
-
- rc = lprocfs_seq_create(proc_lustre_root, "devices", 0444,
- &obd_device_list_fops, NULL);
- if (rc < 0) {
- CERROR("cannot create '/proc/fs/lustre/devices': rc = %d\n",
- rc);
- GOTO(out_proc, rc);
- }
-
- RETURN(rc);
-
-out_proc:
- lprocfs_remove(&proc_lustre_root);
out:
RETURN(rc);
}
{
ENTRY;
+ debugfs_remove_recursive(debugfs_lustre_root);
+
+ debugfs_lustre_root = NULL;
+
if (proc_lustre_root)
lprocfs_remove(&proc_lustre_root);