diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2002-03-14 01:23:08 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2002-03-14 01:23:08 +0000 |
commit | fba1ada51bdfa7fea872c2f6a0e8745584df22c0 (patch) | |
tree | a29496a07899ac93b9cc1d6d5f0dcba3d7dd68b3 /libstore/copy.c | |
parent | 9eccd96bdb880eb489b61959c9bbccf92425fc8a (diff) |
2002-03-14 Marcus Brinkmann <marcus@gnu.org>
* rdwr.c (store_read): Truncate amount to be read to size of
store. Use memcpy rather than bcopy.
(store_write): Return EIO if caller tries to write over the end of
the store.
* copy.c (copy_read): Do not multiply LEN returned from vm_read
with vm_page_size.
Diffstat (limited to 'libstore/copy.c')
-rw-r--r-- | libstore/copy.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libstore/copy.c b/libstore/copy.c index a984fbd2..4e1cf0d4 100644 --- a/libstore/copy.c +++ b/libstore/copy.c @@ -1,6 +1,6 @@ /* Copy store backend - Copyright (C) 1995,96,97,99,2000,01 Free Software Foundation, Inc. + Copyright (C) 1995,96,97,99,2000,01,02 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.org> This file is part of the GNU Hurd. @@ -36,14 +36,10 @@ copy_read (struct store *store, store_offset_t addr, size_t index, char *data = store->hook + (addr * store->block_size); if (page_aligned (data) && page_aligned (amount)) - { - /* When reading whole pages, we can avoid any real copying. */ - error_t err = vm_read (mach_task_self (), - (vm_address_t) data, amount, - (pointer_t *) buf, len); - *len *= vm_page_size; - return err; - } + /* When reading whole pages, we can avoid any real copying. */ + return vm_read (mach_task_self (), + (vm_address_t) data, amount, + (pointer_t *) buf, len); if (*len < amount) /* Have to allocate memory for the return value. */ |