static int seq_client_proc_init(struct lu_client_seq *seq) { #ifdef CONFIG_PROC_FS int rc; ENTRY; seq->lcs_proc_dir = lprocfs_register(seq->lcs_name, seq_type_proc_dir, NULL, NULL); if (IS_ERR(seq->lcs_proc_dir)) { CERROR("%s: LProcFS failed in seq-init\n", seq->lcs_name); rc = PTR_ERR(seq->lcs_proc_dir); RETURN(rc); } rc = lprocfs_add_vars(seq->lcs_proc_dir, seq_client_proc_list, seq); if (rc) { CERROR("%s: Can't init sequence manager " "proc, rc %d\n", seq->lcs_name, rc); GOTO(out_cleanup, rc); } RETURN(0); out_cleanup: seq_client_proc_fini(seq); return rc; #else /* !CONFIG_PROC_FS */ return 0; #endif /* CONFIG_PROC_FS */ }
static int seq_client_proc_init(struct lu_client_seq *seq) { #if defined (CONFIG_PROC_FS) int rc; seq->lcs_proc_dir = lprocfs_register(seq->lcs_name, seq_type_proc_dir, NULL, NULL); if (IS_ERR(seq->lcs_proc_dir)) { CERROR("%s: LProcFS failed in seq-init\n", seq->lcs_name); rc = PTR_ERR(seq->lcs_proc_dir); return rc; } rc = lprocfs_add_vars(seq->lcs_proc_dir, seq_client_proc_list, seq); if (rc) { CERROR("%s: Can't init sequence manager proc, rc %d\n", seq->lcs_name, rc); goto out_cleanup; } return 0; out_cleanup: seq_client_proc_fini(seq); return rc; #else /* CONFIG_PROC_FS */ return 0; #endif }
void seq_client_fini(struct lu_client_seq *seq) { seq_client_proc_fini(seq); if (seq->lcs_exp != NULL) { class_export_put(seq->lcs_exp); seq->lcs_exp = NULL; } seq->lcs_srv = NULL; }