From 5cb8c15669c5ac51b5aa9e33671fef7dcc0916b5 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sun, 7 Jan 2001 19:31:50 +0000 Subject: doc/ 2001-01-07 Marcus Brinkmann * hurd.texi (Diskfs Callbacks): Make diskfs_dirstat_size const. ext2fs/ 2001-01-07 Marcus Brinkmann * dir.c: Make diskfs_dirstat_size const. isofs/ 2001-01-07 Marcus Brinkmann * lookup.c: Make diskfs_dirstat_size const. ufs/ 2001-01-07 Marcus Brinkmann * dir.c: Make diskfs_dirstat_size const. libdiskfs/ 2001-01-07 Marcus Brinkmann * diskfs.h: Make diskfs_dirstat_size const. libdiskfs/ 2001-01-07 Marcus Brinkmann * file-statfs.c: Include . ftpfs/ 2001-01-07 Marcus Brinkmann * dir.c (ftpfs_dir_create): Fix last change (calloc invocation). 2001-01-07 Marcus Brinkmann * copy.c: Include . New macro page_aligned. (copy_write): Cast buf to vm_address_t in call to vm_write. Dereference amount for memcpy. (copy_read): Add len parameter to vm_read, remove redundant following len assignment. --- libstore/copy.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libstore/copy.c') diff --git a/libstore/copy.c b/libstore/copy.c index b5f00c3b..6a4d0d5a 100644 --- a/libstore/copy.c +++ b/libstore/copy.c @@ -24,6 +24,9 @@ #include #include #include +#include + +#define page_aligned(addr) (((size_t) addr & (vm_page_size - 1)) == 0) #include "store.h" @@ -37,8 +40,7 @@ copy_read (struct store *store, { /* 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 = amount; + (vm_address_t) data, amount, (pointer_t *) buf, len); return err; } @@ -65,12 +67,12 @@ copy_write (struct store *store, { /* When reading whole pages, we can avoid any real copying. */ error_t err = vm_write (mach_task_self (), - (vm_address_t) data, buf, len); + (vm_address_t) data, (vm_address_t) buf, len); *amount = len; return err; } - memcpy (data, buf, amount); + memcpy (data, buf, *amount); *amount = len; return 0; } -- cgit v1.2.3