static enum isci_request_status isci_task_validate_request_to_abort( struct isci_request *isci_request, struct isci_host *isci_host, struct isci_remote_device *isci_device, struct completion *aborted_io_completion) { enum isci_request_status old_state = unallocated; if (isci_request && !list_empty(&isci_request->dev_node)) { old_state = isci_request_change_started_to_aborted( isci_request, aborted_io_completion); } return old_state; }
/** * isci_task_validate_request_to_abort() - This function checks the given I/O * against the "started" state. If the request is still "started", it's * state is changed to aborted. NOTE: isci_host->scic_lock MUST BE HELD * BEFORE CALLING THIS FUNCTION. * @isci_request: This parameter specifies the request object to control. * @isci_host: This parameter specifies the ISCI host object * @isci_device: This is the device to which the request is pending. * @aborted_io_completion: This is a completion structure that will be added to * the request in case it is changed to aborting; this completion is * triggered when the request is fully completed. * * Either "started" on successful change of the task status to "aborted", or * "unallocated" if the task cannot be controlled. */ static enum isci_request_status isci_task_validate_request_to_abort( struct isci_request *isci_request, struct isci_host *isci_host, struct isci_remote_device *isci_device, struct completion *aborted_io_completion) { enum isci_request_status old_state = unallocated; /* Only abort the task if it's in the * device's request_in_process list */ if (isci_request && !list_empty(&isci_request->dev_node)) { old_state = isci_request_change_started_to_aborted( isci_request, aborted_io_completion); } return old_state; }