Exemplo n.º 1
0
Arquivo: bs_rbd.c Projeto: chitr/tgt
static tgtadm_err bs_rbd_init(struct scsi_lu *lu)
{
	tgtadm_err ret = TGTADM_UNKNOWN_ERR;
	int rados_ret;
	struct bs_thread_info *info = BS_THREAD_I(lu);

	rados_ret = rados_create(&cluster, NULL);
	if (rados_ret < 0) {
		eprintf("bs_rbd_init: rados_create: %d\n", rados_ret);
		return ret;
	}
	/* read config from environment and then default files */
	rados_ret = rados_conf_parse_env(cluster, NULL);
	if (rados_ret < 0) {
		eprintf("bs_rbd_init: rados_conf_parse_env: %d\n", rados_ret);
		goto fail;
	}
	rados_ret = rados_conf_read_file(cluster, NULL);
	if (rados_ret < 0) {
		eprintf("bs_rbd_init: rados_conf_read_file: %d\n", rados_ret);
		goto fail;
	}
	rados_ret = rados_connect(cluster);
	if (rados_ret < 0) {
		eprintf("bs_rbd_init: rados_connect: %d\n", rados_ret);
		goto fail;
	}
	ret = bs_thread_open(info, bs_rbd_request, nr_iothreads);
	if (ret == TGTADM_SUCCESS)
		return ret;
fail:
	rados_shutdown(&cluster);
	return ret;
}
Exemplo n.º 2
0
static tgtadm_err bs_ssc_init(struct scsi_lu *lu)
{
	struct bs_thread_info *info = BS_THREAD_I(lu);
	return bs_thread_open(info, tape_rdwr_request, 1);
}
Exemplo n.º 3
0
static tgtadm_err bs_rdwr_init(struct scsi_lu *lu, char *bsopts)
{
	struct bs_thread_info *info = BS_THREAD_I(lu);

	return bs_thread_open(info, bs_rdwr_request, nr_iothreads);
}