mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
Patch from Alexey Obitotskiy <alexeyo1@open-e.com> making get_initiator_port_transport_id() more flexible
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3322 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -303,7 +303,8 @@ static void ft_sess_close(struct ft_sess *sess)
|
||||
/*
|
||||
* Allocate and fill in the SPC Transport ID for persistent reservations.
|
||||
*/
|
||||
int ft_get_transport_id(struct scst_session *scst_sess, uint8_t **result)
|
||||
int ft_get_transport_id(struct scst_tgt *tgt, struct scst_session *scst_sess,
|
||||
uint8_t **result)
|
||||
{
|
||||
struct ft_sess *sess;
|
||||
struct {
|
||||
|
||||
@@ -1123,8 +1123,8 @@ static int ibmvstgt_get_serial(const struct scst_tgt_dev *tgt_dev, char *buf,
|
||||
*
|
||||
* See also SPC-3, section 7.5.4.5, TransportID for initiator ports using SRP.
|
||||
*/
|
||||
static int ibmvstgt_get_transportid(struct scst_session *sess,
|
||||
uint8_t **transport_id)
|
||||
static int ibmvstgt_get_transportid(struct scst_tgt *tgt,
|
||||
struct scst_session *sess, uint8_t **transport_id)
|
||||
{
|
||||
struct vio_port *vport;
|
||||
struct spc_rdma_transport_id {
|
||||
|
||||
@@ -3650,8 +3650,8 @@ static int iscsi_report_aen(struct scst_aen *aen)
|
||||
return res;
|
||||
}
|
||||
|
||||
static int iscsi_get_initiator_port_transport_id(struct scst_session *scst_sess,
|
||||
uint8_t **transport_id)
|
||||
static int iscsi_get_initiator_port_transport_id(struct scst_tgt *tgt,
|
||||
struct scst_session *scst_sess, uint8_t **transport_id)
|
||||
{
|
||||
struct iscsi_session *sess;
|
||||
int res = 0;
|
||||
|
||||
@@ -77,8 +77,8 @@ static int __q24_xmit_response(struct q2t_cmd *cmd, int xmit_type);
|
||||
static int q2t_rdy_to_xfer(struct scst_cmd *scst_cmd);
|
||||
static void q2t_on_free_cmd(struct scst_cmd *scst_cmd);
|
||||
static void q2t_task_mgmt_fn_done(struct scst_mgmt_cmd *mcmd);
|
||||
static int q2t_get_initiator_port_transport_id(struct scst_session *scst_sess,
|
||||
uint8_t **transport_id);
|
||||
static int q2t_get_initiator_port_transport_id(struct scst_tgt *tgt,
|
||||
struct scst_session *scst_sess, uint8_t **transport_id);
|
||||
|
||||
/* Predefs for callbacks handed to qla2xxx(target) */
|
||||
static void q24_atio_pkt(scsi_qla_host_t *ha, atio7_entry_t *pkt);
|
||||
@@ -6114,8 +6114,8 @@ out:
|
||||
#endif /*((LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28)) || \
|
||||
defined(FC_VPORT_CREATE_DEFINED))*/
|
||||
|
||||
static int q2t_get_initiator_port_transport_id(struct scst_session *scst_sess,
|
||||
uint8_t **transport_id)
|
||||
static int q2t_get_initiator_port_transport_id(struct scst_tgt *tgt,
|
||||
struct scst_session *scst_sess, uint8_t **transport_id)
|
||||
{
|
||||
struct q2t_sess *sess;
|
||||
int res = 0;
|
||||
|
||||
@@ -1321,8 +1321,8 @@ isp_task_mgmt_fn_done(struct scst_mgmt_cmd *mgmt_cmd)
|
||||
(*bp->h.r_action) (QIN_NOTIFY_ACK, ins);
|
||||
}
|
||||
|
||||
int isp_get_initiator_port_transport_id(struct scst_session *scst_sess,
|
||||
uint8_t **transport_id)
|
||||
int isp_get_initiator_port_transport_id(struct scst_tgt *tgt,
|
||||
struct scst_session *scst_sess, uint8_t **transport_id)
|
||||
{
|
||||
ini_t *ini;
|
||||
int res = 0;
|
||||
|
||||
@@ -871,14 +871,14 @@ struct scst_tgt_template {
|
||||
* kfree() it, when it isn't needed anymore.
|
||||
*
|
||||
* If sess is NULL, this function must return TransportID PROTOCOL
|
||||
* IDENTIFIER of this transport.
|
||||
* IDENTIFIER for the requested target.
|
||||
*
|
||||
* Returns 0 on success or negative error code otherwise.
|
||||
*
|
||||
* SHOULD HAVE, because it's required for Persistent Reservations.
|
||||
*/
|
||||
int (*get_initiator_port_transport_id) (struct scst_session *sess,
|
||||
uint8_t **transport_id);
|
||||
int (*get_initiator_port_transport_id) (struct scst_tgt *tgt,
|
||||
struct scst_session *sess, uint8_t **transport_id);
|
||||
|
||||
/*
|
||||
* This function allows to enable or disable particular target.
|
||||
|
||||
@@ -1469,12 +1469,12 @@ static void scst_pr_unregister_all_tg_pt(struct scst_device *dev,
|
||||
if (tgtt->get_initiator_port_transport_id == NULL)
|
||||
continue;
|
||||
|
||||
if (tgtt->get_initiator_port_transport_id(NULL, NULL) != proto_id)
|
||||
continue;
|
||||
|
||||
list_for_each_entry(tgt, &tgtt->tgt_list, tgt_list_entry) {
|
||||
struct scst_dev_registrant *reg;
|
||||
|
||||
if (tgtt->get_initiator_port_transport_id(tgt, NULL, NULL) != proto_id)
|
||||
continue;
|
||||
|
||||
reg = scst_pr_find_reg(dev, transport_id,
|
||||
tgt->rel_tgt_id);
|
||||
if (reg == NULL)
|
||||
@@ -1556,12 +1556,11 @@ static int scst_pr_register_all_tg_pt(struct scst_cmd *cmd, uint8_t *buffer,
|
||||
if (tgtt->get_initiator_port_transport_id == NULL)
|
||||
continue;
|
||||
|
||||
if (tgtt->get_initiator_port_transport_id(NULL, NULL) != proto_id)
|
||||
continue;
|
||||
|
||||
TRACE_PR("tgtt %s, spec_i_pt %d", tgtt->name, spec_i_pt);
|
||||
|
||||
list_for_each_entry(tgt, &tgtt->tgt_list, tgt_list_entry) {
|
||||
if (tgtt->get_initiator_port_transport_id(tgt, NULL, NULL) != proto_id)
|
||||
continue;
|
||||
if (tgt->rel_tgt_id == 0)
|
||||
continue;
|
||||
TRACE_PR("tgt %s, rel_tgt_id %d", tgt->tgt_name,
|
||||
|
||||
@@ -6198,8 +6198,8 @@ static int scst_init_session(struct scst_session *sess)
|
||||
list_add_tail(&sess->sess_list_entry, &sess->tgt->sess_list);
|
||||
|
||||
if (sess->tgt->tgtt->get_initiator_port_transport_id != NULL) {
|
||||
res = sess->tgt->tgtt->get_initiator_port_transport_id(sess,
|
||||
&sess->transport_id);
|
||||
res = sess->tgt->tgtt->get_initiator_port_transport_id(
|
||||
sess->tgt, sess, &sess->transport_id);
|
||||
if (res != 0) {
|
||||
PRINT_ERROR("Unable to make initiator %s port "
|
||||
"transport id", sess->initiator_name);
|
||||
|
||||
@@ -239,7 +239,8 @@ out:
|
||||
}
|
||||
|
||||
static int scst_local_get_initiator_port_transport_id(
|
||||
struct scst_session *scst_sess, uint8_t **transport_id)
|
||||
struct scst_tgt *tgt, struct scst_session *scst_sess,
|
||||
uint8_t **transport_id)
|
||||
{
|
||||
int res = 0;
|
||||
int tr_id_size = 0;
|
||||
|
||||
@@ -3195,8 +3195,8 @@ static void srpt_tsk_mgmt_done(struct scst_mgmt_cmd *mcmnd)
|
||||
*
|
||||
* See also SPC-3, section 7.5.4.5, TransportID for initiator ports using SRP.
|
||||
*/
|
||||
static int srpt_get_initiator_port_transport_id(struct scst_session *scst_sess,
|
||||
uint8_t **transport_id)
|
||||
static int srpt_get_initiator_port_transport_id(struct scst_tgt *tgt,
|
||||
struct scst_session *scst_sess, uint8_t **transport_id)
|
||||
{
|
||||
struct srpt_rdma_ch *ch;
|
||||
struct spc_rdma_transport_id {
|
||||
|
||||
Reference in New Issue
Block a user