Commit 77eb1699 authored by Andreas Herrmann's avatar Andreas Herrmann Committed by James Bottomley

[SCSI] zfcp: remove function zfcp_fsf_req_wait_and_cleanup

Signed-off-by: default avatarAndreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 059c97d0
...@@ -109,7 +109,6 @@ extern int zfcp_fsf_req_create(struct zfcp_adapter *, u32, int, mempool_t *, ...@@ -109,7 +109,6 @@ extern int zfcp_fsf_req_create(struct zfcp_adapter *, u32, int, mempool_t *,
extern int zfcp_fsf_send_ct(struct zfcp_send_ct *, mempool_t *, extern int zfcp_fsf_send_ct(struct zfcp_send_ct *, mempool_t *,
struct zfcp_erp_action *); struct zfcp_erp_action *);
extern int zfcp_fsf_send_els(struct zfcp_send_els *); extern int zfcp_fsf_send_els(struct zfcp_send_els *);
extern int zfcp_fsf_req_wait_and_cleanup(struct zfcp_fsf_req *, int, u32 *);
extern int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *, extern int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *,
struct zfcp_unit *, struct zfcp_unit *,
struct scsi_cmnd *, struct scsi_cmnd *,
......
...@@ -4548,52 +4548,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) ...@@ -4548,52 +4548,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
return retval; return retval;
} }
/*
* function: zfcp_fsf_req_wait_and_cleanup
*
* purpose:
*
* FIXME(design): signal seems to be <0 !!!
* returns: 0 - request completed (*status is valid), cleanup succ.
* <0 - request completed (*status is valid), cleanup failed
* >0 - signal which interrupted waiting (*status invalid),
* request not completed, no cleanup
*
* *status is a copy of status of completed fsf_req
*/
int
zfcp_fsf_req_wait_and_cleanup(struct zfcp_fsf_req *fsf_req,
int interruptible, u32 * status)
{
int retval = 0;
int signal = 0;
if (interruptible) {
__wait_event_interruptible(fsf_req->completion_wq,
fsf_req->status &
ZFCP_STATUS_FSFREQ_COMPLETED,
signal);
if (signal) {
ZFCP_LOG_DEBUG("Caught signal %i while waiting for the "
"completion of the request at %p\n",
signal, fsf_req);
retval = signal;
goto out;
}
} else {
__wait_event(fsf_req->completion_wq,
fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
}
*status = fsf_req->status;
/* cleanup request */
zfcp_fsf_req_free(fsf_req);
out:
return retval;
}
static inline int static inline int
zfcp_fsf_req_sbal_check(unsigned long *flags, zfcp_fsf_req_sbal_check(unsigned long *flags,
struct zfcp_qdio_queue *queue, int needed) struct zfcp_qdio_queue *queue, int needed)
......
...@@ -558,9 +558,8 @@ static int ...@@ -558,9 +558,8 @@ static int
zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags) zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags)
{ {
struct zfcp_adapter *adapter = unit->port->adapter; struct zfcp_adapter *adapter = unit->port->adapter;
int retval;
int status;
struct zfcp_fsf_req *fsf_req; struct zfcp_fsf_req *fsf_req;
int retval = 0;
/* issue task management function */ /* issue task management function */
fsf_req = zfcp_fsf_send_fcp_command_task_management fsf_req = zfcp_fsf_send_fcp_command_task_management
...@@ -574,18 +573,16 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags) ...@@ -574,18 +573,16 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags)
goto out; goto out;
} }
retval = zfcp_fsf_req_wait_and_cleanup(fsf_req, __wait_event(fsf_req->completion_wq,
ZFCP_UNINTERRUPTIBLE, &status); fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
/*
* check completion status of task management function /* check completion status of task management function */
* (status should always be valid since no signals permitted) if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED)
*/
if (status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED)
retval = -EIO; retval = -EIO;
else if (status & ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP) else if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP)
retval = -ENOTSUPP; retval = -ENOTSUPP;
else
retval = 0; zfcp_fsf_req_free(fsf_req);
out: out:
return retval; return retval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment