aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block')
-rw-r--r--drivers/s390/block/dasd.c105
-rw-r--r--drivers/s390/block/dasd_3370_erp.c1
-rw-r--r--drivers/s390/block/dasd_3990_erp.c1
-rw-r--r--drivers/s390/block/dasd_9336_erp.c1
-rw-r--r--drivers/s390/block/dasd_9343_erp.c1
-rw-r--r--drivers/s390/block/dasd_cmb.c2
-rw-r--r--drivers/s390/block/dasd_devmap.c1
-rw-r--r--drivers/s390/block/dasd_diag.c1
-rw-r--r--drivers/s390/block/dasd_diag.h1
-rw-r--r--drivers/s390/block/dasd_eckd.c1
-rw-r--r--drivers/s390/block/dasd_eckd.h1
-rw-r--r--drivers/s390/block/dasd_erp.c1
-rw-r--r--drivers/s390/block/dasd_fba.c1
-rw-r--r--drivers/s390/block/dasd_fba.h1
-rw-r--r--drivers/s390/block/dasd_genhd.c3
-rw-r--r--drivers/s390/block/dasd_int.h9
-rw-r--r--drivers/s390/block/dasd_ioctl.c11
-rw-r--r--drivers/s390/block/dasd_proc.c4
18 files changed, 98 insertions, 48 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index ef4c687e7c01..33157c84d1d3 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -7,7 +7,6 @@
7 * Bugreports.to..: <Linux390@de.ibm.com> 7 * Bugreports.to..: <Linux390@de.ibm.com>
8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
9 * 9 *
10 * $Revision: 1.172 $
11 */ 10 */
12 11
13#include <linux/config.h> 12#include <linux/config.h>
@@ -153,7 +152,12 @@ static inline void
153dasd_state_known_to_new(struct dasd_device * device) 152dasd_state_known_to_new(struct dasd_device * device)
154{ 153{
155 /* Forget the discipline information. */ 154 /* Forget the discipline information. */
155 if (device->discipline)
156 module_put(device->discipline->owner);
156 device->discipline = NULL; 157 device->discipline = NULL;
158 if (device->base_discipline)
159 module_put(device->base_discipline->owner);
160 device->base_discipline = NULL;
157 device->state = DASD_STATE_NEW; 161 device->state = DASD_STATE_NEW;
158 162
159 dasd_free_queue(device); 163 dasd_free_queue(device);
@@ -211,9 +215,10 @@ dasd_state_basic_to_known(struct dasd_device * device)
211 * interrupt for this detection ccw uses the kernel event daemon to 215 * interrupt for this detection ccw uses the kernel event daemon to
212 * trigger the call to dasd_change_state. All this is done in the 216 * trigger the call to dasd_change_state. All this is done in the
213 * discipline code, see dasd_eckd.c. 217 * discipline code, see dasd_eckd.c.
214 * After the analysis ccw is done (do_analysis returned 0 or error) 218 * After the analysis ccw is done (do_analysis returned 0) the block
215 * the block device is setup. Either a fake disk is added to allow 219 * device is setup.
216 * formatting or a proper device request queue is created. 220 * In case the analysis returns an error, the device setup is stopped
221 * (a fake disk was already added to allow formatting).
217 */ 222 */
218static inline int 223static inline int
219dasd_state_basic_to_ready(struct dasd_device * device) 224dasd_state_basic_to_ready(struct dasd_device * device)
@@ -223,13 +228,19 @@ dasd_state_basic_to_ready(struct dasd_device * device)
223 rc = 0; 228 rc = 0;
224 if (device->discipline->do_analysis != NULL) 229 if (device->discipline->do_analysis != NULL)
225 rc = device->discipline->do_analysis(device); 230 rc = device->discipline->do_analysis(device);
226 if (rc) 231 if (rc) {
232 if (rc != -EAGAIN)
233 device->state = DASD_STATE_UNFMT;
227 return rc; 234 return rc;
235 }
236 /* make disk known with correct capacity */
228 dasd_setup_queue(device); 237 dasd_setup_queue(device);
238 set_capacity(device->gdp, device->blocks << device->s2b_shift);
229 device->state = DASD_STATE_READY; 239 device->state = DASD_STATE_READY;
230 if (dasd_scan_partitions(device) != 0) 240 rc = dasd_scan_partitions(device);
241 if (rc)
231 device->state = DASD_STATE_BASIC; 242 device->state = DASD_STATE_BASIC;
232 return 0; 243 return rc;
233} 244}
234 245
235/* 246/*
@@ -250,6 +261,15 @@ dasd_state_ready_to_basic(struct dasd_device * device)
250} 261}
251 262
252/* 263/*
264 * Back to basic.
265 */
266static inline void
267dasd_state_unfmt_to_basic(struct dasd_device * device)
268{
269 device->state = DASD_STATE_BASIC;
270}
271
272/*
253 * Make the device online and schedule the bottom half to start 273 * Make the device online and schedule the bottom half to start
254 * the requeueing of requests from the linux request queue to the 274 * the requeueing of requests from the linux request queue to the
255 * ccw queue. 275 * ccw queue.
@@ -315,8 +335,12 @@ dasd_decrease_state(struct dasd_device *device)
315 if (device->state == DASD_STATE_READY && 335 if (device->state == DASD_STATE_READY &&
316 device->target <= DASD_STATE_BASIC) 336 device->target <= DASD_STATE_BASIC)
317 dasd_state_ready_to_basic(device); 337 dasd_state_ready_to_basic(device);
318 338
319 if (device->state == DASD_STATE_BASIC && 339 if (device->state == DASD_STATE_UNFMT &&
340 device->target <= DASD_STATE_BASIC)
341 dasd_state_unfmt_to_basic(device);
342
343 if (device->state == DASD_STATE_BASIC &&
320 device->target <= DASD_STATE_KNOWN) 344 device->target <= DASD_STATE_KNOWN)
321 dasd_state_basic_to_known(device); 345 dasd_state_basic_to_known(device);
322 346
@@ -675,11 +699,8 @@ dasd_term_IO(struct dasd_ccw_req * cqr)
675 rc = ccw_device_clear(device->cdev, (long) cqr); 699 rc = ccw_device_clear(device->cdev, (long) cqr);
676 switch (rc) { 700 switch (rc) {
677 case 0: /* termination successful */ 701 case 0: /* termination successful */
678 if (cqr->retries > 0) { 702 cqr->retries--;
679 cqr->retries--; 703 cqr->status = DASD_CQR_CLEAR;
680 cqr->status = DASD_CQR_CLEAR;
681 } else
682 cqr->status = DASD_CQR_FAILED;
683 cqr->stopclk = get_clock(); 704 cqr->stopclk = get_clock();
684 DBF_DEV_EVENT(DBF_DEBUG, device, 705 DBF_DEV_EVENT(DBF_DEBUG, device,
685 "terminate cqr %p successful", 706 "terminate cqr %p successful",
@@ -1308,7 +1329,7 @@ dasd_tasklet(struct dasd_device * device)
1308 /* Now call the callback function of requests with final status */ 1329 /* Now call the callback function of requests with final status */
1309 list_for_each_safe(l, n, &final_queue) { 1330 list_for_each_safe(l, n, &final_queue) {
1310 cqr = list_entry(l, struct dasd_ccw_req, list); 1331 cqr = list_entry(l, struct dasd_ccw_req, list);
1311 list_del(&cqr->list); 1332 list_del_init(&cqr->list);
1312 if (cqr->callback != NULL) 1333 if (cqr->callback != NULL)
1313 (cqr->callback)(cqr, cqr->callback_data); 1334 (cqr->callback)(cqr, cqr->callback_data);
1314 } 1335 }
@@ -1393,7 +1414,9 @@ _wait_for_wakeup(struct dasd_ccw_req *cqr)
1393 1414
1394 device = cqr->device; 1415 device = cqr->device;
1395 spin_lock_irq(get_ccwdev_lock(device->cdev)); 1416 spin_lock_irq(get_ccwdev_lock(device->cdev));
1396 rc = cqr->status == DASD_CQR_DONE || cqr->status == DASD_CQR_FAILED; 1417 rc = ((cqr->status == DASD_CQR_DONE ||
1418 cqr->status == DASD_CQR_FAILED) &&
1419 list_empty(&cqr->list));
1397 spin_unlock_irq(get_ccwdev_lock(device->cdev)); 1420 spin_unlock_irq(get_ccwdev_lock(device->cdev));
1398 return rc; 1421 return rc;
1399} 1422}
@@ -1457,15 +1480,37 @@ dasd_sleep_on_interruptible(struct dasd_ccw_req * cqr)
1457 while (!finished) { 1480 while (!finished) {
1458 rc = wait_event_interruptible(wait_q, _wait_for_wakeup(cqr)); 1481 rc = wait_event_interruptible(wait_q, _wait_for_wakeup(cqr));
1459 if (rc != -ERESTARTSYS) { 1482 if (rc != -ERESTARTSYS) {
1460 /* Request status is either done or failed. */ 1483 /* Request is final (done or failed) */
1461 rc = (cqr->status == DASD_CQR_FAILED) ? -EIO : 0; 1484 rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO;
1462 break; 1485 break;
1463 } 1486 }
1464 spin_lock_irq(get_ccwdev_lock(device->cdev)); 1487 spin_lock_irq(get_ccwdev_lock(device->cdev));
1465 if (cqr->status == DASD_CQR_IN_IO && 1488 switch (cqr->status) {
1466 device->discipline->term_IO(cqr) == 0) { 1489 case DASD_CQR_IN_IO:
1467 list_del(&cqr->list); 1490 /* terminate runnig cqr */
1491 if (device->discipline->term_IO) {
1492 cqr->retries = -1;
1493 device->discipline->term_IO(cqr);
1494 /*nished =
1495 * wait (non-interruptible) for final status
1496 * because signal ist still pending
1497 */
1498 spin_unlock_irq(get_ccwdev_lock(device->cdev));
1499 wait_event(wait_q, _wait_for_wakeup(cqr));
1500 spin_lock_irq(get_ccwdev_lock(device->cdev));
1501 rc = (cqr->status == DASD_CQR_DONE) ? 0 : -EIO;
1502 finished = 1;
1503 }
1504 break;
1505 case DASD_CQR_QUEUED:
1506 /* request */
1507 list_del_init(&cqr->list);
1508 rc = -EIO;
1468 finished = 1; 1509 finished = 1;
1510 break;
1511 default:
1512 /* cqr with 'non-interruptable' status - just wait */
1513 break;
1469 } 1514 }
1470 spin_unlock_irq(get_ccwdev_lock(device->cdev)); 1515 spin_unlock_irq(get_ccwdev_lock(device->cdev));
1471 } 1516 }
@@ -1697,7 +1742,7 @@ dasd_open(struct inode *inp, struct file *filp)
1697 goto out; 1742 goto out;
1698 } 1743 }
1699 1744
1700 if (device->state < DASD_STATE_BASIC) { 1745 if (device->state <= DASD_STATE_BASIC) {
1701 DBF_DEV_EVENT(DBF_ERR, device, " %s", 1746 DBF_DEV_EVENT(DBF_ERR, device, " %s",
1702 " Cannot open unrecognized device"); 1747 " Cannot open unrecognized device");
1703 rc = -ENODEV; 1748 rc = -ENODEV;
@@ -1839,9 +1884,10 @@ dasd_generic_remove (struct ccw_device *cdev)
1839 */ 1884 */
1840int 1885int
1841dasd_generic_set_online (struct ccw_device *cdev, 1886dasd_generic_set_online (struct ccw_device *cdev,
1842 struct dasd_discipline *discipline) 1887 struct dasd_discipline *base_discipline)
1843 1888
1844{ 1889{
1890 struct dasd_discipline *discipline;
1845 struct dasd_device *device; 1891 struct dasd_device *device;
1846 int rc; 1892 int rc;
1847 1893
@@ -1849,6 +1895,7 @@ dasd_generic_set_online (struct ccw_device *cdev,
1849 if (IS_ERR(device)) 1895 if (IS_ERR(device))
1850 return PTR_ERR(device); 1896 return PTR_ERR(device);
1851 1897
1898 discipline = base_discipline;
1852 if (device->features & DASD_FEATURE_USEDIAG) { 1899 if (device->features & DASD_FEATURE_USEDIAG) {
1853 if (!dasd_diag_discipline_pointer) { 1900 if (!dasd_diag_discipline_pointer) {
1854 printk (KERN_WARNING 1901 printk (KERN_WARNING
@@ -1860,6 +1907,16 @@ dasd_generic_set_online (struct ccw_device *cdev,
1860 } 1907 }
1861 discipline = dasd_diag_discipline_pointer; 1908 discipline = dasd_diag_discipline_pointer;
1862 } 1909 }
1910 if (!try_module_get(base_discipline->owner)) {
1911 dasd_delete_device(device);
1912 return -EINVAL;
1913 }
1914 if (!try_module_get(discipline->owner)) {
1915 module_put(base_discipline->owner);
1916 dasd_delete_device(device);
1917 return -EINVAL;
1918 }
1919 device->base_discipline = base_discipline;
1863 device->discipline = discipline; 1920 device->discipline = discipline;
1864 1921
1865 rc = discipline->check_device(device); 1922 rc = discipline->check_device(device);
@@ -1868,6 +1925,8 @@ dasd_generic_set_online (struct ccw_device *cdev,
1868 "dasd_generic couldn't online device %s " 1925 "dasd_generic couldn't online device %s "
1869 "with discipline %s rc=%i\n", 1926 "with discipline %s rc=%i\n",
1870 cdev->dev.bus_id, discipline->name, rc); 1927 cdev->dev.bus_id, discipline->name, rc);
1928 module_put(discipline->owner);
1929 module_put(base_discipline->owner);
1871 dasd_delete_device(device); 1930 dasd_delete_device(device);
1872 return rc; 1931 return rc;
1873 } 1932 }
diff --git a/drivers/s390/block/dasd_3370_erp.c b/drivers/s390/block/dasd_3370_erp.c
index 84565c8f584e..1d11c2a9525d 100644
--- a/drivers/s390/block/dasd_3370_erp.c
+++ b/drivers/s390/block/dasd_3370_erp.c
@@ -4,7 +4,6 @@
4 * Bugreports.to..: <Linux390@de.ibm.com> 4 * Bugreports.to..: <Linux390@de.ibm.com>
5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
6 * 6 *
7 * $Revision: 1.9 $
8 */ 7 */
9 8
10#define PRINTK_HEADER "dasd_erp(3370)" 9#define PRINTK_HEADER "dasd_erp(3370)"
diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c
index c143ecb53d9d..4ee0f934e325 100644
--- a/drivers/s390/block/dasd_3990_erp.c
+++ b/drivers/s390/block/dasd_3990_erp.c
@@ -5,7 +5,6 @@
5 * Bugreports.to..: <Linux390@de.ibm.com> 5 * Bugreports.to..: <Linux390@de.ibm.com>
6 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001 6 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001
7 * 7 *
8 * $Revision: 1.36 $
9 */ 8 */
10 9
11#include <linux/timer.h> 10#include <linux/timer.h>
diff --git a/drivers/s390/block/dasd_9336_erp.c b/drivers/s390/block/dasd_9336_erp.c
index 01e87170a3a2..dc861446d056 100644
--- a/drivers/s390/block/dasd_9336_erp.c
+++ b/drivers/s390/block/dasd_9336_erp.c
@@ -4,7 +4,6 @@
4 * Bugreports.to..: <Linux390@de.ibm.com> 4 * Bugreports.to..: <Linux390@de.ibm.com>
5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
6 * 6 *
7 * $Revision: 1.8 $
8 */ 7 */
9 8
10#define PRINTK_HEADER "dasd_erp(9336)" 9#define PRINTK_HEADER "dasd_erp(9336)"
diff --git a/drivers/s390/block/dasd_9343_erp.c b/drivers/s390/block/dasd_9343_erp.c
index 2a23b74faf3f..4a5b79569aaa 100644
--- a/drivers/s390/block/dasd_9343_erp.c
+++ b/drivers/s390/block/dasd_9343_erp.c
@@ -4,7 +4,6 @@
4 * Bugreports.to..: <Linux390@de.ibm.com> 4 * Bugreports.to..: <Linux390@de.ibm.com>
5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000 5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000
6 * 6 *
7 * $Revision: 1.13 $
8 */ 7 */
9 8
10#define PRINTK_HEADER "dasd_erp(9343)" 9#define PRINTK_HEADER "dasd_erp(9343)"
diff --git a/drivers/s390/block/dasd_cmb.c b/drivers/s390/block/dasd_cmb.c
index 4f365bff275c..e88f73ee72ce 100644
--- a/drivers/s390/block/dasd_cmb.c
+++ b/drivers/s390/block/dasd_cmb.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/drivers/s390/block/dasd_cmb.c ($Revision: 1.9 $)
3 *
4 * Linux on zSeries Channel Measurement Facility support 2 * Linux on zSeries Channel Measurement Facility support
5 * (dasd device driver interface) 3 * (dasd device driver interface)
6 * 4 *
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index caee16a3dc62..1629b27c48ab 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -11,7 +11,6 @@
11 * functions may not be called from interrupt context. In particular 11 * functions may not be called from interrupt context. In particular
12 * dasd_get_device is a no-no from interrupt context. 12 * dasd_get_device is a no-no from interrupt context.
13 * 13 *
14 * $Revision: 1.43 $
15 */ 14 */
16 15
17#include <linux/config.h> 16#include <linux/config.h>
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index ba80fdea7ebf..3f9d704d2657 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -6,7 +6,6 @@
6 * Bugreports.to..: <Linux390@de.ibm.com> 6 * Bugreports.to..: <Linux390@de.ibm.com>
7 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 7 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
8 * 8 *
9 * $Revision: 1.53 $
10 */ 9 */
11 10
12#include <linux/config.h> 11#include <linux/config.h>
diff --git a/drivers/s390/block/dasd_diag.h b/drivers/s390/block/dasd_diag.h
index a4f80bd735f1..38a4e55f8953 100644
--- a/drivers/s390/block/dasd_diag.h
+++ b/drivers/s390/block/dasd_diag.h
@@ -6,7 +6,6 @@
6 * Bugreports.to..: <Linux390@de.ibm.com> 6 * Bugreports.to..: <Linux390@de.ibm.com>
7 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 7 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
8 * 8 *
9 * $Revision: 1.9 $
10 */ 9 */
11 10
12#define MDSK_WRITE_REQ 0x01 11#define MDSK_WRITE_REQ 0x01
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 96eb48258580..822e2a265578 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -7,7 +7,6 @@
7 * Bugreports.to..: <Linux390@de.ibm.com> 7 * Bugreports.to..: <Linux390@de.ibm.com>
8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
9 * 9 *
10 * $Revision: 1.74 $
11 */ 10 */
12 11
13#include <linux/config.h> 12#include <linux/config.h>
diff --git a/drivers/s390/block/dasd_eckd.h b/drivers/s390/block/dasd_eckd.h
index b6888c68b224..bc3823d35223 100644
--- a/drivers/s390/block/dasd_eckd.h
+++ b/drivers/s390/block/dasd_eckd.h
@@ -5,7 +5,6 @@
5 * Bugreports.to..: <Linux390@de.ibm.com> 5 * Bugreports.to..: <Linux390@de.ibm.com>
6 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 6 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
7 * 7 *
8 * $Revision: 1.10 $
9 */ 8 */
10 9
11#ifndef DASD_ECKD_H 10#ifndef DASD_ECKD_H
diff --git a/drivers/s390/block/dasd_erp.c b/drivers/s390/block/dasd_erp.c
index 7cb98d25f341..8fd71ab02ef0 100644
--- a/drivers/s390/block/dasd_erp.c
+++ b/drivers/s390/block/dasd_erp.c
@@ -7,7 +7,6 @@
7 * Bugreports.to..: <Linux390@de.ibm.com> 7 * Bugreports.to..: <Linux390@de.ibm.com>
8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
9 * 9 *
10 * $Revision: 1.14 $
11 */ 10 */
12 11
13#include <linux/config.h> 12#include <linux/config.h>
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index 8ec75dc08e2c..91145698f8e9 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -4,7 +4,6 @@
4 * Bugreports.to..: <Linux390@de.ibm.com> 4 * Bugreports.to..: <Linux390@de.ibm.com>
5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
6 * 6 *
7 * $Revision: 1.41 $
8 */ 7 */
9 8
10#include <linux/config.h> 9#include <linux/config.h>
diff --git a/drivers/s390/block/dasd_fba.h b/drivers/s390/block/dasd_fba.h
index 624f0402ee22..da1fa91fc01d 100644
--- a/drivers/s390/block/dasd_fba.h
+++ b/drivers/s390/block/dasd_fba.h
@@ -4,7 +4,6 @@
4 * Bugreports.to..: <Linux390@de.ibm.com> 4 * Bugreports.to..: <Linux390@de.ibm.com>
5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 5 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
6 * 6 *
7 * $Revision: 1.6 $
8 */ 7 */
9 8
10#ifndef DASD_FBA_H 9#ifndef DASD_FBA_H
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index a601c9a33541..fce2835e7d19 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -9,7 +9,6 @@
9 * 9 *
10 * gendisk related functions for the dasd driver. 10 * gendisk related functions for the dasd driver.
11 * 11 *
12 * $Revision: 1.51 $
13 */ 12 */
14 13
15#include <linux/config.h> 14#include <linux/config.h>
@@ -101,8 +100,6 @@ dasd_scan_partitions(struct dasd_device * device)
101{ 100{
102 struct block_device *bdev; 101 struct block_device *bdev;
103 102
104 /* Make the disk known. */
105 set_capacity(device->gdp, device->blocks << device->s2b_shift);
106 bdev = bdget_disk(device->gdp, 0); 103 bdev = bdget_disk(device->gdp, 0);
107 if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0) 104 if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0)
108 return -ENODEV; 105 return -ENODEV;
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index e4b401500b01..7cb0b9e78a6a 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -6,7 +6,6 @@
6 * Bugreports.to..: <Linux390@de.ibm.com> 6 * Bugreports.to..: <Linux390@de.ibm.com>
7 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 7 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
8 * 8 *
9 * $Revision: 1.68 $
10 */ 9 */
11 10
12#ifndef DASD_INT_H 11#ifndef DASD_INT_H
@@ -27,7 +26,7 @@
27 * new: the dasd_device structure is allocated. 26 * new: the dasd_device structure is allocated.
28 * known: the discipline for the device is identified. 27 * known: the discipline for the device is identified.
29 * basic: the device can do basic i/o. 28 * basic: the device can do basic i/o.
30 * accept: the device is analysed (format is known). 29 * unfmt: the device could not be analyzed (format is unknown).
31 * ready: partition detection is done and the device is can do block io. 30 * ready: partition detection is done and the device is can do block io.
32 * online: the device accepts requests from the block device queue. 31 * online: the device accepts requests from the block device queue.
33 * 32 *
@@ -48,8 +47,9 @@
48#define DASD_STATE_NEW 0 47#define DASD_STATE_NEW 0
49#define DASD_STATE_KNOWN 1 48#define DASD_STATE_KNOWN 1
50#define DASD_STATE_BASIC 2 49#define DASD_STATE_BASIC 2
51#define DASD_STATE_READY 3 50#define DASD_STATE_UNFMT 3
52#define DASD_STATE_ONLINE 4 51#define DASD_STATE_READY 4
52#define DASD_STATE_ONLINE 5
53 53
54#include <linux/module.h> 54#include <linux/module.h>
55#include <linux/wait.h> 55#include <linux/wait.h>
@@ -291,6 +291,7 @@ struct dasd_device {
291 291
292 /* Device discipline stuff. */ 292 /* Device discipline stuff. */
293 struct dasd_discipline *discipline; 293 struct dasd_discipline *discipline;
294 struct dasd_discipline *base_discipline;
294 char *private; 295 char *private;
295 296
296 /* Device state and target state. */ 297 /* Device state and target state. */
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 9396fcacb8f8..fafeeae52675 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -7,8 +7,6 @@
7 * Bugreports.to..: <Linux390@de.ibm.com> 7 * Bugreports.to..: <Linux390@de.ibm.com>
8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 8 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
9 * 9 *
10 * $Revision: 1.50 $
11 *
12 * i/o controls for the dasd driver. 10 * i/o controls for the dasd driver.
13 */ 11 */
14#include <linux/config.h> 12#include <linux/config.h>
@@ -423,8 +421,15 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args)
423 dasd_info->cu_model = cdev->id.cu_model; 421 dasd_info->cu_model = cdev->id.cu_model;
424 dasd_info->dev_type = cdev->id.dev_type; 422 dasd_info->dev_type = cdev->id.dev_type;
425 dasd_info->dev_model = cdev->id.dev_model; 423 dasd_info->dev_model = cdev->id.dev_model;
426 dasd_info->open_count = atomic_read(&device->open_count);
427 dasd_info->status = device->state; 424 dasd_info->status = device->state;
425 /*
426 * The open_count is increased for every opener, that includes
427 * the blkdev_get in dasd_scan_partitions.
428 * This must be hidden from user-space.
429 */
430 dasd_info->open_count = atomic_read(&device->open_count);
431 if (!device->bdev)
432 dasd_info->open_count++;
428 433
429 /* 434 /*
430 * check if device is really formatted 435 * check if device is really formatted
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index fff9020d4886..1aa3c261718a 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -9,7 +9,6 @@
9 * 9 *
10 * /proc interface for the dasd driver. 10 * /proc interface for the dasd driver.
11 * 11 *
12 * $Revision: 1.33 $
13 */ 12 */
14 13
15#include <linux/config.h> 14#include <linux/config.h>
@@ -94,6 +93,9 @@ dasd_devices_show(struct seq_file *m, void *v)
94 case DASD_STATE_BASIC: 93 case DASD_STATE_BASIC:
95 seq_printf(m, "basic"); 94 seq_printf(m, "basic");
96 break; 95 break;
96 case DASD_STATE_UNFMT:
97 seq_printf(m, "unformatted");
98 break;
97 case DASD_STATE_READY: 99 case DASD_STATE_READY:
98 case DASD_STATE_ONLINE: 100 case DASD_STATE_ONLINE:
99 seq_printf(m, "active "); 101 seq_printf(m, "active ");