int class_procfs_init(void)
{
int rc = -ENOMEM;
- struct dentry *file;
lustre_kobj = kobject_create_and_add("lustre", fs_kobj);
if (!lustre_kobj)
}
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;
- sysfs_remove_group(lustre_kobj, &lustre_attr_group);
- 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;
- sysfs_remove_group(lustre_kobj, &lustre_attr_group);
- kobject_put(lustre_kobj);
- goto out;
- }
+ debugfs_create_file("devices", 0444, debugfs_lustre_root, NULL,
+ &obd_device_list_fops);
out:
return rc;
}
if (fops->write)
mode |= 0200;
entry = debugfs_create_file(name, mode, root, data, fops);
- if (IS_ERR_OR_NULL(entry)) {
- CERROR("LprocFS: No memory to create <debugfs> entry %s\n", name);
- return entry ?: ERR_PTR(-ENOMEM);
- }
return entry;
}
EXPORT_SYMBOL_GPL(ldebugfs_add_simple);
list->data ?: data,
list->fops ?: &lprocfs_generic_fops
);
- if (IS_ERR_OR_NULL(entry))
- return entry ? PTR_ERR(entry) : -ENOMEM;
list++;
}
return 0;
entry = debugfs_create_file(name, 0644, parent, stats,
&lprocfs_stats_seq_fops);
- if (IS_ERR_OR_NULL(entry))
- return entry ? PTR_ERR(entry) : -ENOMEM;
-
return 0;
}
EXPORT_SYMBOL_GPL(ldebugfs_register_stats);
LASSERT((!seq_fops->write) == ((mode & 0222) == 0));
entry = debugfs_create_file(name, mode, parent, data, seq_fops);
- if (IS_ERR_OR_NULL(entry))
- return entry ? PTR_ERR(entry) : -ENOMEM;
return 0;
}