Exemplo n.º 1
0
static int seq_server_proc_init(struct lu_server_seq *seq)
{
	int rc;
	ENTRY;

	seq->lss_proc_dir = lprocfs_register(seq->lss_name,
					     seq_type_proc_dir,
					     NULL, NULL);
	if (IS_ERR(seq->lss_proc_dir)) {
		rc = PTR_ERR(seq->lss_proc_dir);
		RETURN(rc);
	}

	rc = lprocfs_add_vars(seq->lss_proc_dir,
			      seq_server_proc_list, seq);
	if (rc) {
		CERROR("%s: Can't init sequence manager "
		       "proc, rc %d\n", seq->lss_name, rc);
		GOTO(out_cleanup, rc);
	}

	RETURN(0);

out_cleanup:
	seq_server_proc_fini(seq);
	return rc;
}
Exemplo n.º 2
0
void seq_server_fini(struct lu_server_seq *seq,
		     const struct lu_env *env)
{
	ENTRY;

	seq_server_proc_fini(seq);
	seq_store_fini(seq, env);

	EXIT;
}
Exemplo n.º 3
0
static int seq_server_proc_init(struct lu_server_seq *seq)
{
#ifdef CONFIG_PROC_FS
	int rc;
	ENTRY;

	seq->lss_proc_dir = lprocfs_register(seq->lss_name,
					     seq_type_proc_dir,
					     NULL, NULL);
	if (IS_ERR(seq->lss_proc_dir)) {
		rc = PTR_ERR(seq->lss_proc_dir);
		RETURN(rc);
	}

	rc = lprocfs_add_vars(seq->lss_proc_dir, seq_server_proc_list, seq);
	if (rc) {
		CERROR("%s: Can't init sequence manager "
		       "proc, rc %d\n", seq->lss_name, rc);
		GOTO(out_cleanup, rc);
	}

	if (seq->lss_type == LUSTRE_SEQ_CONTROLLER) {
		rc = lprocfs_seq_create(seq->lss_proc_dir, "fldb", 0644,
					&seq_fld_proc_seq_fops, seq);
		if (rc) {
			CERROR("%s: Can't create fldb for sequence manager "
			       "proc: rc = %d\n", seq->lss_name, rc);
			GOTO(out_cleanup, rc);
		}
	}

	RETURN(0);

out_cleanup:
	seq_server_proc_fini(seq);
	return rc;
#else /* !CONFIG_PROC_FS */
	return 0;
#endif /* CONFIG_PROC_FS */
}