summaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
Diffstat (limited to 'libstore')
-rw-r--r--libstore/copy.c6
-rw-r--r--libstore/device.c13
-rw-r--r--libstore/file.c9
-rw-r--r--libstore/rdwr.c6
-rw-r--r--libstore/remap.c6
-rw-r--r--libstore/store.h6
-rw-r--r--libstore/stripe.c6
-rw-r--r--libstore/task.c9
-rw-r--r--libstore/zero.c4
9 files changed, 35 insertions, 30 deletions
diff --git a/libstore/copy.c b/libstore/copy.c
index 25ea1259..b870f4fc 100644
--- a/libstore/copy.c
+++ b/libstore/copy.c
@@ -1,7 +1,6 @@
/* Copy store backend
- Copyright (C) 1995,96,97,99,2000 Free Software Foundation, Inc.
-
+ Copyright (C) 1995,96,97,99,2000,01 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.org>
This task is part of the GNU Hurd.
@@ -59,7 +58,8 @@ copy_read (struct store *store,
static error_t
copy_write (struct store *store,
- store_offset_t addr, size_t index, void *buf, size_t len, size_t *amount)
+ store_offset_t addr, size_t index,
+ const void *buf, size_t len, size_t *amount)
{
char *data = store->hook + (addr * store->block_size);
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;
diff --git a/libstore/file.c b/libstore/file.c
index 4f9a1b6e..8c62d85c 100644
--- a/libstore/file.c
+++ b/libstore/file.c
@@ -1,7 +1,7 @@
/* File store backend
- Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc.
- Written by Miles Bader <miles@gnu.ai.mit.edu>
+ Copyright (C) 1995,96,97,98,2001 Free Software Foundation, Inc.
+ Written by Miles Bader <miles@gnu.org>
This file is part of the GNU Hurd.
The GNU Hurd is free software; you can redistribute it and/or
@@ -38,7 +38,7 @@ file_read (struct store *store,
static error_t
file_write (struct store *store,
- store_offset_t addr, size_t index, void *buf, size_t len,
+ store_offset_t addr, size_t index, const void *buf, size_t len,
size_t *amount)
{
size_t bsize = store->block_size;
@@ -207,7 +207,8 @@ file_byte_read (struct store *store,
static error_t
file_byte_write (struct store *store,
- store_offset_t addr, size_t index, void *buf, size_t len,
+ store_offset_t addr, size_t index,
+ const void *buf, size_t len,
size_t *amount)
{
return io_write (store->port, buf, len, addr, amount);
diff --git a/libstore/rdwr.c b/libstore/rdwr.c
index e79f56a2..f6652a12 100644
--- a/libstore/rdwr.c
+++ b/libstore/rdwr.c
@@ -1,7 +1,7 @@
/* Store I/O
- Copyright (C) 1995, 96, 97, 98, 1999 Free Software Foundation, Inc.
- Written by Miles Bader <miles@gnu.ai.mit.edu>
+ Copyright (C) 1995,96,97,98,99,2001 Free Software Foundation, Inc.
+ Written by Miles Bader <miles@gnu.org>
This file is part of the GNU Hurd.
The GNU Hurd is free software; you can redistribute it and/or
@@ -95,7 +95,7 @@ store_next_run (struct store *store, struct store_run *runs_end,
in AMOUNT. ADDR is in BLOCKS (as defined by STORE->block_size). */
error_t
store_write (struct store *store,
- store_offset_t addr, void *buf, size_t len, size_t *amount)
+ store_offset_t addr, const void *buf, size_t len, size_t *amount)
{
error_t err;
size_t index;
diff --git a/libstore/remap.c b/libstore/remap.c
index 6dd104e8..34a2f1a0 100644
--- a/libstore/remap.c
+++ b/libstore/remap.c
@@ -1,7 +1,7 @@
/* Block address translation
- Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
- Written by Miles Bader <miles@gnu.ai.mit.edu>
+ Copyright (C) 1996,97,99,2001 Free Software Foundation, Inc.
+ Written by Miles Bader <miles@gnu.org>
This file is part of the GNU Hurd.
The GNU Hurd is free software; you can redistribute it and/or
@@ -35,7 +35,7 @@ remap_read (struct store *store,
static error_t
remap_write (struct store *store,
- store_offset_t addr, size_t index, void *buf, size_t len,
+ store_offset_t addr, size_t index, const void *buf, size_t len,
size_t *amount)
{
return store_write (store->children[0], addr, buf, len, amount);
diff --git a/libstore/store.h b/libstore/store.h
index 6d95746a..141b946f 100644
--- a/libstore/store.h
+++ b/libstore/store.h
@@ -125,7 +125,8 @@ struct store
typedef error_t (*store_write_meth_t)(struct store *store,
store_offset_t addr, size_t index,
- void *buf, mach_msg_type_number_t len,
+ const void *buf,
+ mach_msg_type_number_t len,
mach_msg_type_number_t *amount);
typedef error_t (*store_read_meth_t)(struct store *store,
store_offset_t addr, size_t index,
@@ -296,7 +297,8 @@ error_t store_remap (struct store *source,
/* Write LEN bytes from BUF to STORE at ADDR. Returns the amount written in
AMOUNT (in bytes). ADDR is in BLOCKS (as defined by STORE->block_size). */
error_t store_write (struct store *store,
- store_offset_t addr, void *buf, size_t len, size_t *amount);
+ store_offset_t addr, const void *buf, size_t len,
+ size_t *amount);
/* Read AMOUNT bytes from STORE at ADDR into BUF & LEN (which following the
usual mach buffer-return semantics) to STORE at ADDR. ADDR is in BLOCKS
diff --git a/libstore/stripe.c b/libstore/stripe.c
index 52a596df..daa0d0d3 100644
--- a/libstore/stripe.c
+++ b/libstore/stripe.c
@@ -1,6 +1,6 @@
/* Striped store backend
- Copyright (C) 1996,97,99 Free Software Foundation, Inc.
+ Copyright (C) 1996,97,99,2001 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.org>
This file is part of the GNU Hurd.
@@ -49,8 +49,8 @@ stripe_read (struct store *store,
static error_t
stripe_write (struct store *store,
- store_offset_t addr, size_t index, void *buf, size_t len,
- size_t *amount)
+ store_offset_t addr, size_t index,
+ const void *buf, size_t len, size_t *amount)
{
struct store *stripe = store->children[index];
return
diff --git a/libstore/task.c b/libstore/task.c
index aad91c2c..c25af7a9 100644
--- a/libstore/task.c
+++ b/libstore/task.c
@@ -1,7 +1,7 @@
/* Mach task store backend
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
- Written by Miles Bader <miles@gnu.ai.mit.edu>
+ Copyright (C) 1995,96,97,2001 Free Software Foundation, Inc.
+ Written by Miles Bader <miles@gnu.org>
This file is part of the GNU Hurd.
The GNU Hurd is free software; you can redistribute it and/or
@@ -64,7 +64,8 @@ task_read (struct store *store,
static error_t
task_write (struct store *store,
- store_offset_t addr, size_t index, void *buf, size_t len, size_t *amount)
+ store_offset_t addr, size_t index,
+ const void *buf, size_t len, size_t *amount)
{
size_t bsize = store->block_size;
error_t err = vm_write (store->port, addr * bsize, (vm_address_t)buf, len);
@@ -159,7 +160,7 @@ _store_task_create (task_t task, int flags, size_t block_size,
task, flags, block_size, runs, num_runs, 0, store);
else
err = EINVAL; /* block size less than page size. */
-
+
if (! err)
{
pid_t pid;
diff --git a/libstore/zero.c b/libstore/zero.c
index 4452179b..3a17c1d8 100644
--- a/libstore/zero.c
+++ b/libstore/zero.c
@@ -1,6 +1,6 @@
/* Zero store backend
- Copyright (C) 1995,96,97,99,2000 Free Software Foundation, Inc.
+ Copyright (C) 1995,96,97,99,2000,01 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.org>
This file is part of the GNU Hurd.
@@ -49,7 +49,7 @@ zero_read (struct store *store,
static error_t
zero_write (struct store *store,
- store_offset_t addr, size_t index, void *buf, size_t len,
+ store_offset_t addr, size_t index, const void *buf, size_t len,
size_t *amount)
{
return 0;