diff options
author | Roland McGrath <roland@gnu.org> | 1999-05-01 06:09:04 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-05-01 06:09:04 +0000 |
commit | d9df4e1dc3b77167ee4b78064845fbd81632de9e (patch) | |
tree | 355638ae1e3a98e77c6fbeb024d467ecbfe7f3c0 /linux/dev | |
parent | ac553887fcb56654edbcc86d0346f798719b2600 (diff) |
1999-05-01 Mark Kettenis <kettenis@gnu.org>
* linux/dev/glue/block.c (device_get_status): Always set
status_count to DEV_GET_STATUS_COUNT if flavor is DEV_GET_SIZE.
Diffstat (limited to 'linux/dev')
-rw-r--r-- | linux/dev/glue/block.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/linux/dev/glue/block.c b/linux/dev/glue/block.c index 9d6bd6d..7900e72 100644 --- a/linux/dev/glue/block.c +++ b/linux/dev/glue/block.c @@ -1595,8 +1595,6 @@ device_get_status (void *d, dev_flavor_t flavor, dev_status_t status, switch (flavor) { case DEV_GET_SIZE: - if (*status_count != DEV_GET_SIZE_COUNT) - return D_INVALID_SIZE; if (disk_major (MAJOR (bd->dev))) { assert (bd->ds->gd); @@ -1626,6 +1624,12 @@ device_get_status (void *d, dev_flavor_t flavor, dev_status_t status, the driver, but a lot of user level code assumes the sector size to be 512. */ status[DEV_GET_SIZE_RECORD_SIZE] = 512; + /* Always return DEV_GET_SIZE_COUNT. This is what all native + Mach drivers do, and makes it possible to detect the absence + of the call by setting it to a different value on input. MiG + makes sure that we will never return more integers than the + user asked for. */ + *status_count = DEV_GET_SIZE_COUNT; break; case V_GETPARMS: |