if (IS_ERR(pl->pl_proc_dir)) {
CERROR("LProcFS failed in ldlm-pool-init\n");
rc = PTR_ERR(pl->pl_proc_dir);
+ pl->pl_proc_dir = NULL;
GOTO(out_free_name, rc);
}
ll_remote_perm_cachep = NULL;
kmem_cache_destroy(ll_file_data_slab);
- if (proc_lustre_fs_root)
+ if (proc_lustre_fs_root && !IS_ERR(proc_lustre_fs_root))
lprocfs_remove(&proc_lustre_fs_root);
}
lprocfs_obd_setup(obd, lvars.obd_vars);
#ifdef LPROCFS
{
- int rc;
+ int rc1;
- rc = lprocfs_seq_create(obd->obd_proc_entry, "target_obd",
+ rc1 = lprocfs_seq_create(obd->obd_proc_entry, "target_obd",
0444, &lov_proc_target_fops, obd);
- if (rc)
+ if (rc1)
CWARN("Error adding the target_obd file\n");
}
#endif
int class_procfs_init(void)
{
- int rc;
+ int rc = 0;
ENTRY;
obd_sysctl_init();
proc_lustre_root = lprocfs_register("fs/lustre", NULL,
lprocfs_base, NULL);
+ if (IS_ERR(proc_lustre_root)) {
+ rc = PTR_ERR(proc_lustre_root);
+ proc_lustre_root = NULL;
+ goto out;
+ }
+
rc = lprocfs_seq_create(proc_lustre_root, "devices", 0444,
&obd_device_list_fops, NULL);
+out:
if (rc)
CERROR("error adding /proc/fs/lustre/devices file\n");
RETURN(0);
struct proc_dir_entry *parent,
struct lprocfs_vars *list, void *data)
{
- struct proc_dir_entry *newchild;
-
- newchild = proc_mkdir(name, parent);
- if (newchild != NULL && list != NULL) {
- int rc = lprocfs_add_vars(newchild, list, data);
- if (rc) {
- lprocfs_remove(&newchild);
- return ERR_PTR(rc);
+ struct proc_dir_entry *entry;
+
+ entry = proc_mkdir(name, parent);
+ if (entry == NULL)
+ GOTO(out, entry = ERR_PTR(-ENOMEM));
+
+ if (list != NULL) {
+ int rc = lprocfs_add_vars(entry, list, data);
+ if (rc != 0) {
+ lprocfs_remove(&entry);
+ entry = ERR_PTR(rc);
}
}
- return newchild;
+out:
+ return entry;
}
EXPORT_SYMBOL(lprocfs_register);
NULL, NULL);
OBD_FREE(buffer, LNET_NIDSTR_SIZE);
- if (new_stat->nid_proc == NULL) {
+ if (IS_ERR(new_stat->nid_proc)) {
CERROR("Error making export directory for nid %s\n",
libcfs_nid2str(*nid));
- GOTO(destroy_new_ns, rc = -ENOMEM);
+ rc = PTR_ERR(new_stat->nid_proc);
+ new_stat->nid_proc = NULL;
+ GOTO(destroy_new_ns, rc);
}
entry = lprocfs_add_simple(new_stat->nid_proc, "uuid",
gss_proc_root = lprocfs_register("gss", sptlrpc_proc_root,
gss_lprocfs_vars, NULL);
if (IS_ERR(gss_proc_root)) {
+ rc = PTR_ERR(gss_proc_root);
gss_proc_root = NULL;
- GOTO(err_out, rc = PTR_ERR(gss_proc_root));
+ GOTO(err_out, rc);
}
gss_proc_lk = lprocfs_register("lgss_keyring", gss_proc_root,
gss_lk_lprocfs_vars, NULL);
if (IS_ERR(gss_proc_lk)) {
+ rc = PTR_ERR(gss_proc_lk);
gss_proc_lk = NULL;
- GOTO(err_out, rc = PTR_ERR(gss_proc_root));
+ GOTO(err_out, rc);
}
return 0;