Skip to content

Commit 86cb69b

Browse files
Martin SchwidefskyLinus Torvalds
authored andcommitted
[PATCH] s390 (3/7): dasd driver.
- Remove dynamic allocation of major numbers. Just use static major 94. - Use bus_id instead of device number where possible. - Don't check open_count in dasd_generic_set_offline.
1 parent 748f7f3 commit 86cb69b

File tree

5 files changed

+182
-309
lines changed

5 files changed

+182
-309
lines changed

drivers/s390/block/dasd.c

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Bugreports.to..: <Linux390@de.ibm.com>
88
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
99
*
10-
* $Revision: 1.110 $
10+
* $Revision: 1.114 $
1111
*/
1212

1313
#include <linux/config.h>
@@ -1142,8 +1142,8 @@ __dasd_process_blk_queue(struct dasd_device * device)
11421142
req = elv_next_request(queue);
11431143
if (device->ro_flag && rq_data_dir(req) == WRITE) {
11441144
DBF_EVENT(DBF_ERR,
1145-
"(%04x) Rejecting write request %p",
1146-
_ccw_device_get_device_number(device->cdev),
1145+
"(%s) Rejecting write request %p",
1146+
device->cdev->dev.bus_id,
11471147
req);
11481148
blkdev_dequeue_request(req);
11491149
dasd_end_request(req, 0);
@@ -1154,8 +1154,8 @@ __dasd_process_blk_queue(struct dasd_device * device)
11541154
if (PTR_ERR(cqr) == -ENOMEM)
11551155
break; /* terminate request queue loop */
11561156
DBF_EVENT(DBF_ERR,
1157-
"(%04x) CCW creation failed on request %p",
1158-
_ccw_device_get_device_number(device->cdev),
1157+
"(%s) CCW creation failed on request %p",
1158+
device->cdev->dev.bus_id,
11591159
req);
11601160
blkdev_dequeue_request(req);
11611161
dasd_end_request(req, 0);
@@ -1728,12 +1728,10 @@ int
17281728
dasd_generic_probe (struct ccw_device *cdev,
17291729
struct dasd_discipline *discipline)
17301730
{
1731-
int devno;
17321731
int ret = 0;
17331732

1734-
devno = _ccw_device_get_device_number(cdev);
1735-
if (dasd_autodetect
1736-
&& (ret = dasd_add_range(devno, devno, DASD_FEATURE_DEFAULT))) {
1733+
if (dasd_autodetect &&
1734+
(ret = dasd_add_busid(cdev->dev.bus_id, DASD_FEATURE_DEFAULT))) {
17371735
printk (KERN_WARNING
17381736
"dasd_generic_probe: cannot autodetect %s\n",
17391737
cdev->dev.bus_id);
@@ -1830,12 +1828,6 @@ dasd_generic_set_offline (struct ccw_device *cdev)
18301828
struct dasd_device *device;
18311829

18321830
device = cdev->dev.driver_data;
1833-
if (atomic_read(&device->open_count) > 0) {
1834-
printk (KERN_WARNING "Can't offline dasd device with open"
1835-
" count = %i.\n",
1836-
atomic_read(&device->open_count));
1837-
return -EBUSY;
1838-
}
18391831
dasd_set_target_state(device, DASD_STATE_NEW);
18401832
dasd_delete_device(device);
18411833

@@ -1854,7 +1846,6 @@ dasd_generic_auto_online (struct ccw_driver *dasd_discipline_driver)
18541846
struct device_driver *drv;
18551847
struct device *d, *dev;
18561848
struct ccw_device *cdev;
1857-
int devno;
18581849

18591850
drv = get_driver(&dasd_discipline_driver->driver);
18601851
down_read(&drv->bus->subsys.rwsem);
@@ -1864,8 +1855,7 @@ dasd_generic_auto_online (struct ccw_driver *dasd_discipline_driver)
18641855
if (!dev)
18651856
continue;
18661857
cdev = to_ccwdev(dev);
1867-
devno = _ccw_device_get_device_number(cdev);
1868-
if (dasd_autodetect || dasd_devno_in_range(devno) == 0)
1858+
if (dasd_autodetect || dasd_busid_known(cdev->dev.bus_id) == 0)
18691859
ccw_device_set_online(cdev);
18701860
put_device(dev);
18711861
}
@@ -1934,31 +1924,6 @@ dasd_use_diag_store(struct device *dev, const char *buf, size_t count)
19341924
static
19351925
DEVICE_ATTR(use_diag, 0644, dasd_use_diag_show, dasd_use_diag_store);
19361926

1937-
#if 0
1938-
/* this file shows the same information as /proc/dasd/devices using
1939-
* an inaccaptable interface */
1940-
/* TODO: Split this up into smaller files! */
1941-
static ssize_t
1942-
dasd_devices_show(struct device *dev, char *buf)
1943-
{
1944-
1945-
struct dasd_device *device;
1946-
dasd_devmap_t *devmap;
1947-
1948-
devmap = NULL;
1949-
device = dev->driver_data;
1950-
if (device)
1951-
devmap = dasd_devmap_from_devno(device->devno);
1952-
1953-
if (!devmap)
1954-
return sprintf(buf, "unused\n");
1955-
1956-
return min ((size_t) dasd_devices_print(devmap, buf), PAGE_SIZE);
1957-
}
1958-
1959-
static DEVICE_ATTR(dasd, 0444, dasd_devices_show, 0);
1960-
#endif
1961-
19621927
static ssize_t
19631928
dasd_discipline_show(struct device *dev, char *buf)
19641929
{
@@ -1973,7 +1938,6 @@ dasd_discipline_show(struct device *dev, char *buf)
19731938
static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL);
19741939

19751940
static struct attribute * dasd_attrs[] = {
1976-
//&dev_attr_dasd.attr,
19771941
&dev_attr_readonly.attr,
19781942
&dev_attr_discipline.attr,
19791943
&dev_attr_use_diag.attr,

0 commit comments

Comments
 (0)