scsi.c (dd0a11815a339d6deeea8357574f8126a8404c92) scsi.c (59566b6e8cc8f8a05022e0f01a1b90974003f092)
1/*******************************************************************************
2 * Vhost kernel TCM fabric driver for virtio SCSI initiators
3 *
4 * (C) Copyright 2010-2013 Datera, Inc.
5 * (C) Copyright 2010-2012 IBM Corp.
6 *
7 * Licensed to the Linux Foundation under the General Public License (GPL) version 2.
8 *

--- 1403 unchanged lines hidden (view full) ---

1412 vqs[VHOST_SCSI_VQ_CTL] = &vs->vqs[VHOST_SCSI_VQ_CTL].vq;
1413 vqs[VHOST_SCSI_VQ_EVT] = &vs->vqs[VHOST_SCSI_VQ_EVT].vq;
1414 vs->vqs[VHOST_SCSI_VQ_CTL].vq.handle_kick = vhost_scsi_ctl_handle_kick;
1415 vs->vqs[VHOST_SCSI_VQ_EVT].vq.handle_kick = vhost_scsi_evt_handle_kick;
1416 for (i = VHOST_SCSI_VQ_IO; i < VHOST_SCSI_MAX_VQ; i++) {
1417 vqs[i] = &vs->vqs[i].vq;
1418 vs->vqs[i].vq.handle_kick = vhost_scsi_handle_kick;
1419 }
1/*******************************************************************************
2 * Vhost kernel TCM fabric driver for virtio SCSI initiators
3 *
4 * (C) Copyright 2010-2013 Datera, Inc.
5 * (C) Copyright 2010-2012 IBM Corp.
6 *
7 * Licensed to the Linux Foundation under the General Public License (GPL) version 2.
8 *

--- 1403 unchanged lines hidden (view full) ---

1412 vqs[VHOST_SCSI_VQ_CTL] = &vs->vqs[VHOST_SCSI_VQ_CTL].vq;
1413 vqs[VHOST_SCSI_VQ_EVT] = &vs->vqs[VHOST_SCSI_VQ_EVT].vq;
1414 vs->vqs[VHOST_SCSI_VQ_CTL].vq.handle_kick = vhost_scsi_ctl_handle_kick;
1415 vs->vqs[VHOST_SCSI_VQ_EVT].vq.handle_kick = vhost_scsi_evt_handle_kick;
1416 for (i = VHOST_SCSI_VQ_IO; i < VHOST_SCSI_MAX_VQ; i++) {
1417 vqs[i] = &vs->vqs[i].vq;
1418 vs->vqs[i].vq.handle_kick = vhost_scsi_handle_kick;
1419 }
1420 r = vhost_dev_init(&vs->dev, vqs, VHOST_SCSI_MAX_VQ);
1420 vhost_dev_init(&vs->dev, vqs, VHOST_SCSI_MAX_VQ);
1421
1422 tcm_vhost_init_inflight(vs, NULL);
1423
1421
1422 tcm_vhost_init_inflight(vs, NULL);
1423
1424 if (r < 0)
1425 goto err_init;
1426
1427 f->private_data = vs;
1428 return 0;
1429
1424 f->private_data = vs;
1425 return 0;
1426
1430err_init:
1431 kfree(vqs);
1432err_vqs:
1433 vhost_scsi_free(vs);
1434err_vs:
1435 return r;
1436}
1437
1438static int vhost_scsi_release(struct inode *inode, struct file *f)
1439{

--- 723 unchanged lines hidden (view full) ---

2163 }
2164 /*
2165 * Setup fabric->tf_ops from our local tcm_vhost_ops
2166 */
2167 fabric->tf_ops = tcm_vhost_ops;
2168 /*
2169 * Setup default attribute lists for various fabric->tf_cit_tmpl
2170 */
1427err_vqs:
1428 vhost_scsi_free(vs);
1429err_vs:
1430 return r;
1431}
1432
1433static int vhost_scsi_release(struct inode *inode, struct file *f)
1434{

--- 723 unchanged lines hidden (view full) ---

2158 }
2159 /*
2160 * Setup fabric->tf_ops from our local tcm_vhost_ops
2161 */
2162 fabric->tf_ops = tcm_vhost_ops;
2163 /*
2164 * Setup default attribute lists for various fabric->tf_cit_tmpl
2165 */
2171 TF_CIT_TMPL(fabric)->tfc_wwn_cit.ct_attrs = tcm_vhost_wwn_attrs;
2172 TF_CIT_TMPL(fabric)->tfc_tpg_base_cit.ct_attrs = tcm_vhost_tpg_attrs;
2173 TF_CIT_TMPL(fabric)->tfc_tpg_attrib_cit.ct_attrs = NULL;
2174 TF_CIT_TMPL(fabric)->tfc_tpg_param_cit.ct_attrs = NULL;
2175 TF_CIT_TMPL(fabric)->tfc_tpg_np_base_cit.ct_attrs = NULL;
2176 TF_CIT_TMPL(fabric)->tfc_tpg_nacl_base_cit.ct_attrs = NULL;
2177 TF_CIT_TMPL(fabric)->tfc_tpg_nacl_attrib_cit.ct_attrs = NULL;
2178 TF_CIT_TMPL(fabric)->tfc_tpg_nacl_auth_cit.ct_attrs = NULL;
2179 TF_CIT_TMPL(fabric)->tfc_tpg_nacl_param_cit.ct_attrs = NULL;
2166 fabric->tf_cit_tmpl.tfc_wwn_cit.ct_attrs = tcm_vhost_wwn_attrs;
2167 fabric->tf_cit_tmpl.tfc_tpg_base_cit.ct_attrs = tcm_vhost_tpg_attrs;
2168 fabric->tf_cit_tmpl.tfc_tpg_attrib_cit.ct_attrs = NULL;
2169 fabric->tf_cit_tmpl.tfc_tpg_param_cit.ct_attrs = NULL;
2170 fabric->tf_cit_tmpl.tfc_tpg_np_base_cit.ct_attrs = NULL;
2171 fabric->tf_cit_tmpl.tfc_tpg_nacl_base_cit.ct_attrs = NULL;
2172 fabric->tf_cit_tmpl.tfc_tpg_nacl_attrib_cit.ct_attrs = NULL;
2173 fabric->tf_cit_tmpl.tfc_tpg_nacl_auth_cit.ct_attrs = NULL;
2174 fabric->tf_cit_tmpl.tfc_tpg_nacl_param_cit.ct_attrs = NULL;
2180 /*
2181 * Register the fabric for use within TCM
2182 */
2183 ret = target_fabric_configfs_register(fabric);
2184 if (ret < 0) {
2185 pr_err("target_fabric_configfs_register() failed"
2186 " for TCM_VHOST\n");
2187 return ret;

--- 60 unchanged lines hidden ---
2175 /*
2176 * Register the fabric for use within TCM
2177 */
2178 ret = target_fabric_configfs_register(fabric);
2179 if (ret < 0) {
2180 pr_err("target_fabric_configfs_register() failed"
2181 " for TCM_VHOST\n");
2182 return ret;

--- 60 unchanged lines hidden ---