summaryrefslogtreecommitdiff
path: root/drivers/s390/scsi/zfcp_cfdc.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2009-11-24 16:54:00 +0100
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 12:02:02 -0600
commitde3dc57214a1466034ecc4d4ffb10331d34c09a3 (patch)
tree63eb490d66f9db2cf032041392fb2f4d5ac4785c /drivers/s390/scsi/zfcp_cfdc.c
parentf3450c7b917201bb49d67032e9f60d5125675d6a (diff)
[SCSI] zfcp: Remove global config_mutex
The global config_mutex was required for the serialization of a configuration change within the zfcp driver. This global locking is now obsolete and can be removed. The requirement of serializing the access to a zfcp_adapter reference via a ccw_device is realized wth a static spinlock. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_cfdc.c')
-rw-r--r--drivers/s390/scsi/zfcp_cfdc.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/s390/scsi/zfcp_cfdc.c b/drivers/s390/scsi/zfcp_cfdc.c
index 856f82dbcb1b..f932400e980a 100644
--- a/drivers/s390/scsi/zfcp_cfdc.c
+++ b/drivers/s390/scsi/zfcp_cfdc.c
@@ -86,22 +86,17 @@ static int zfcp_cfdc_copy_to_user(void __user *user_buffer,
static struct zfcp_adapter *zfcp_cfdc_get_adapter(u32 devno)
{
char busid[9];
- struct ccw_device *ccwdev;
- struct zfcp_adapter *adapter = NULL;
+ struct ccw_device *cdev;
+ struct zfcp_adapter *adapter;
snprintf(busid, sizeof(busid), "0.0.%04x", devno);
- ccwdev = get_ccwdev_by_busid(&zfcp_ccw_driver, busid);
- if (!ccwdev)
- goto out;
-
- adapter = dev_get_drvdata(&ccwdev->dev);
- if (!adapter)
- goto out_put;
-
- kref_get(&adapter->ref);
-out_put:
- put_device(&ccwdev->dev);
-out:
+ cdev = get_ccwdev_by_busid(&zfcp_ccw_driver, busid);
+ if (!cdev)
+ return NULL;
+
+ adapter = zfcp_ccw_adapter_by_cdev(cdev);
+
+ put_device(&cdev->dev);
return adapter;
}
@@ -244,7 +239,7 @@ static long zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
free_sg:
zfcp_sg_free_table(fsf_cfdc->sg, ZFCP_CFDC_PAGES);
adapter_put:
- kref_put(&adapter->ref, zfcp_adapter_release);
+ zfcp_ccw_adapter_put(adapter);
free_buffer:
kfree(data);
no_mem_sense: