aboutsummaryrefslogtreecommitdiff
path: root/libstore/device.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-03-07 15:01:37 +0000
committerRoland McGrath <roland@gnu.org>2001-03-07 15:01:37 +0000
commitd1d9c14d8e50a8f263775f7e0a71bda5dd6686f6 (patch)
tree49d446315742c508ed2762e3e76560312c071d63 /libstore/device.c
parentb8ba3388ad76fe7e022a44e5422e0723770fc908 (diff)
downloadhurd-d1d9c14d8e50a8f263775f7e0a71bda5dd6686f6.tar.gz
hurd-d1d9c14d8e50a8f263775f7e0a71bda5dd6686f6.tar.bz2
hurd-d1d9c14d8e50a8f263775f7e0a71bda5dd6686f6.zip
2001-03-07 Roland McGrath <roland@frob.com>
* store.h (store_write, store_write_meth_t): Make buffer arg const*. * copy.c (copy_write): Likewise. * device.c (dev_write): Likewise. * file.c (file_write): Likewise. (file_byte_write): Likewise. * rdwr.c (store_write): Likewise. * remap.c (remap_write): Likewise. * stripe.c (stripe_write): Likewise. * task.c (task_write): Likewise. * zero.c (zero_write): Likewise.
Diffstat (limited to 'libstore/device.c')
-rw-r--r--libstore/device.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libstore/device.c b/libstore/device.c
index 97fe8036..5a18c85b 100644
--- a/libstore/device.c
+++ b/libstore/device.c
@@ -1,6 +1,6 @@
/* Mach device store backend
- Copyright (C) 1995,96,97,99 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,99,2001 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.org>
This file is part of the GNU Hurd.
@@ -57,7 +57,8 @@ dev_read (struct store *store,
static error_t
dev_write (struct store *store,
- store_offset_t addr, size_t index, void *buf, mach_msg_type_number_t len,
+ store_offset_t addr, size_t index,
+ const void *buf, mach_msg_type_number_t len,
mach_msg_type_number_t *amount)
{
return dev_error (device_write (store->port, 0, addr,
@@ -155,12 +156,12 @@ enforced (struct store *store)
return EINVAL;
assert (sizes_len == DEV_GET_SIZE_COUNT);
-
+
if (sizes[DEV_GET_SIZE_RECORD_SIZE] != store->block_size
|| (store->runs[0].length !=
sizes[DEV_GET_SIZE_DEVICE_SIZE] >> store->log2_block_size))
return EINVAL;
-
+
return 0;
}
}
@@ -266,12 +267,12 @@ store_device_create (device_t device, int flags, struct store **store)
if (! err && sizes_len == DEV_GET_SIZE_COUNT)
{
block_size = sizes[DEV_GET_SIZE_RECORD_SIZE];
-
+
if (block_size)
{
run.start = 0;
run.length = sizes[DEV_GET_SIZE_DEVICE_SIZE] / block_size;
-
+
if (run.length * block_size != sizes[DEV_GET_SIZE_DEVICE_SIZE])
/* Bogus results (which some mach devices return). */
block_size = 0;