Scroll to navigation

SCSI_INTERNAL_DEVICE(9) SCSI mid layer SCSI_INTERNAL_DEVICE(9)

NAME

scsi_internal_device_block - internal function to put a device temporarily into the SDEV_BLOCK state

SYNOPSIS

int scsi_internal_device_block(struct scsi_device * sdev, bool wait);

ARGUMENTS

struct scsi_device * sdev

device to block

bool wait

Whether or not to wait until ongoing .queuecommand / .queue_rq calls have finished.

DESCRIPTION

Block request made by scsi lld's to temporarily stop all scsi commands on the specified device. May sleep.

Returns zero if successful or error if not

NOTES

This routine transitions the device to the SDEV_BLOCK state (which must be a legal transition). When the device is in this state, all commands are deferred until the scsi lld reenables the device with scsi_device_unblock or device_block_tmo fires.

To do: avoid that scsi_send_eh_cmnd calls queuecommand after scsi_internal_device_block has blocked a SCSI device and also remove the rport mutex lock and unlock calls from srp_queuecommand.

AUTHORS

James Bottomley <James.Bottomley@hansenpartnership.com>

Author.

Rob Landley <rob@landley.net>

Author.

COPYRIGHT

June 2017 Kernel Hackers Manual 4.11