Commit 4f777ed2 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by James Bottomley

[SCSI] kill scsi_assign_lock

scsi_assign_lock has been unused for a long time and is a bad idea
in general, so kill it.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 3b003157
...@@ -375,7 +375,6 @@ Summary: ...@@ -375,7 +375,6 @@ Summary:
scsi_add_device - creates new scsi device (lu) instance scsi_add_device - creates new scsi device (lu) instance
scsi_add_host - perform sysfs registration and set up transport class scsi_add_host - perform sysfs registration and set up transport class
scsi_adjust_queue_depth - change the queue depth on a SCSI device scsi_adjust_queue_depth - change the queue depth on a SCSI device
scsi_assign_lock - replace default host_lock with given lock
scsi_bios_ptable - return copy of block device's partition table scsi_bios_ptable - return copy of block device's partition table
scsi_block_requests - prevent further commands being queued to given host scsi_block_requests - prevent further commands being queued to given host
scsi_deactivate_tcq - turn off tag command queueing scsi_deactivate_tcq - turn off tag command queueing
...@@ -488,20 +487,6 @@ void scsi_adjust_queue_depth(struct scsi_device * sdev, int tagged, ...@@ -488,20 +487,6 @@ void scsi_adjust_queue_depth(struct scsi_device * sdev, int tagged,
int tags) int tags)
/**
* scsi_assign_lock - replace default host_lock with given lock
* @shost: a pointer to a scsi host instance
* @lock: pointer to lock to replace host_lock for this host
*
* Returns nothing
*
* Might block: no
*
* Defined in: include/scsi/scsi_host.h .
**/
void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
/** /**
* scsi_bios_ptable - return copy of block device's partition table * scsi_bios_ptable - return copy of block device's partition table
* @dev: pointer to block device * @dev: pointer to block device
...@@ -1366,17 +1351,11 @@ Locks ...@@ -1366,17 +1351,11 @@ Locks
Each struct Scsi_Host instance has a spin_lock called struct Each struct Scsi_Host instance has a spin_lock called struct
Scsi_Host::default_lock which is initialized in scsi_host_alloc() [found in Scsi_Host::default_lock which is initialized in scsi_host_alloc() [found in
hosts.c]. Within the same function the struct Scsi_Host::host_lock pointer hosts.c]. Within the same function the struct Scsi_Host::host_lock pointer
is initialized to point at default_lock with the scsi_assign_lock() function. is initialized to point at default_lock. Thereafter lock and unlock
Thereafter lock and unlock operations performed by the mid level use the operations performed by the mid level use the struct Scsi_Host::host_lock
struct Scsi_Host::host_lock pointer. pointer. Previously drivers could override the host_lock pointer but
this is not allowed anymore.
LLDs can override the use of struct Scsi_Host::default_lock by
using scsi_assign_lock(). The earliest opportunity to do this would
be in the detect() function after it has invoked scsi_register(). It
could be replaced by a coarser grain lock (e.g. per driver) or a
lock of equal granularity (i.e. per host). Using finer grain locks
(e.g. per SCSI device) may be possible by juggling locks in
queuecommand().
Autosense Autosense
========= =========
......
...@@ -301,8 +301,8 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) ...@@ -301,8 +301,8 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
if (!shost) if (!shost)
return NULL; return NULL;
spin_lock_init(&shost->default_lock); shost->host_lock = &shost->default_lock;
scsi_assign_lock(shost, &shost->default_lock); spin_lock_init(shost->host_lock);
shost->shost_state = SHOST_CREATED; shost->shost_state = SHOST_CREATED;
INIT_LIST_HEAD(&shost->__devices); INIT_LIST_HEAD(&shost->__devices);
INIT_LIST_HEAD(&shost->__targets); INIT_LIST_HEAD(&shost->__targets);
......
...@@ -651,11 +651,6 @@ extern const char *scsi_host_state_name(enum scsi_host_state); ...@@ -651,11 +651,6 @@ extern const char *scsi_host_state_name(enum scsi_host_state);
extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
{
shost->host_lock = lock;
}
static inline struct device *scsi_get_device(struct Scsi_Host *shost) static inline struct device *scsi_get_device(struct Scsi_Host *shost)
{ {
return shost->shost_gendev.parent; return shost->shost_gendev.parent;
......
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