/* Fail I/O to all paths not in state active/optimized or active/non-optimized.  */
static int alua_prep_fn(struct scsi_device *sdev, struct request *req)
/* Fail I/O to all paths not in state active/optimized or active/non-optimized.  */
static int alua_prep_fn(struct scsi_device *sdev, struct request *req)
{
	struct alua_dh_data *h = get_alua_data(sdev);
	int ret = BLKPREP_OK;
	if (h->state != TPGS_STATE_OPTIMIZED &&
	    h->state != TPGS_STATE_NONOPTIMIZED) {
		ret = BLKPREP_KILL;
		req->cmd_flags |= REQ_QUIET;
	}
	return ret;
}