@@ -2775,21 +2775,20 @@ int scsi_internal_device_block_nowait(struct scsi_device *sdev)
2775
2775
EXPORT_SYMBOL_GPL (scsi_internal_device_block_nowait );
2776
2776
2777
2777
/**
2778
- * scsi_internal_device_block - try to transition to the SDEV_BLOCK state
2778
+ * scsi_device_block - try to transition to the SDEV_BLOCK state
2779
2779
* @sdev: device to block
2780
+ * @data: dummy argument, ignored
2780
2781
*
2781
2782
* Pause SCSI command processing on the specified device and wait until all
2782
- * ongoing scsi_request_fn() / scsi_queue_rq() calls have finished. May sleep.
2783
- *
2784
- * Returns zero if successful or a negative error code upon failure.
2783
+ * ongoing scsi_queue_rq() calls have finished. May sleep.
2785
2784
*
2786
2785
* Note:
2787
2786
* This routine transitions the device to the SDEV_BLOCK state (which must be
2788
2787
* a legal transition). When the device is in this state, command processing
2789
2788
* is paused until the device leaves the SDEV_BLOCK state. See also
2790
2789
* scsi_internal_device_unblock().
2791
2790
*/
2792
- static int scsi_internal_device_block (struct scsi_device * sdev )
2791
+ static void scsi_device_block (struct scsi_device * sdev , void * data )
2793
2792
{
2794
2793
int err ;
2795
2794
@@ -2799,7 +2798,8 @@ static int scsi_internal_device_block(struct scsi_device *sdev)
2799
2798
scsi_stop_queue (sdev , false);
2800
2799
mutex_unlock (& sdev -> state_mutex );
2801
2800
2802
- return err ;
2801
+ WARN_ONCE (err , "__scsi_internal_device_block_nowait(%s) failed: err = %d\n" ,
2802
+ dev_name (& sdev -> sdev_gendev ), err );
2803
2803
}
2804
2804
2805
2805
/**
@@ -2882,23 +2882,12 @@ static int scsi_internal_device_unblock(struct scsi_device *sdev,
2882
2882
return ret ;
2883
2883
}
2884
2884
2885
- static void
2886
- device_block (struct scsi_device * sdev , void * data )
2887
- {
2888
- int ret ;
2889
-
2890
- ret = scsi_internal_device_block (sdev );
2891
-
2892
- WARN_ONCE (ret , "scsi_internal_device_block(%s) failed: ret = %d\n" ,
2893
- dev_name (& sdev -> sdev_gendev ), ret );
2894
- }
2895
-
2896
2885
static int
2897
2886
target_block (struct device * dev , void * data )
2898
2887
{
2899
2888
if (scsi_is_target_device (dev ))
2900
2889
starget_for_each_device (to_scsi_target (dev ), NULL ,
2901
- device_block );
2890
+ scsi_device_block );
2902
2891
return 0 ;
2903
2892
}
2904
2893
@@ -2907,7 +2896,7 @@ scsi_target_block(struct device *dev)
2907
2896
{
2908
2897
if (scsi_is_target_device (dev ))
2909
2898
starget_for_each_device (to_scsi_target (dev ), NULL ,
2910
- device_block );
2899
+ scsi_device_block );
2911
2900
else
2912
2901
device_for_each_child (dev , NULL , target_block );
2913
2902
}
0 commit comments