From c50fe92b8dc1b0867eaaeee365f6b5d0f4ff5217 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 5 May 2002 22:42:40 +0000 Subject: [PATCH] o Condition the compilation of uiomoveco() and vm_uiomove() on ENABLE_VFS_IOOPT. o Add a comment to the effect that this code is experimental support for zero-copy I/O. --- sys/kern/kern_subr.c | 10 +++++++--- sys/sys/uio.h | 2 ++ sys/vm/vm_map.c | 4 ++++ sys/vm/vm_map.h | 4 +++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 9f2ede2d4c95..73aa75bbef89 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -134,6 +134,10 @@ uiomove(cp, n, uio) return (error); } +#ifdef ENABLE_VFS_IOOPT +/* + * Experimental support for zero-copy I/O + */ int uiomoveco(cp, n, uio, obj) caddr_t cp; @@ -207,8 +211,9 @@ uiomoveco(cp, n, uio, obj) return (0); } -#ifdef ENABLE_VFS_IOOPT - +/* + * Experimental support for zero-copy I/O + */ int uioread(n, uio, obj, nread) int n; @@ -274,7 +279,6 @@ uioread(n, uio, obj, nread) } return error; } - #endif /* diff --git a/sys/sys/uio.h b/sys/sys/uio.h index e09ca3fa023e..59e54f185426 100644 --- a/sys/sys/uio.h +++ b/sys/sys/uio.h @@ -86,8 +86,10 @@ struct vm_object; void uio_yield(void); int uiomove(caddr_t, int, struct uio *); +#ifdef ENABLE_VFS_IOOPT /* Experimental support for zero-copy I/O */ int uiomoveco(caddr_t, int, struct uio *, struct vm_object *); int uioread(int, struct uio *, struct vm_object *, int *); +#endif int copyinfrom(const void *src, void *dst, size_t len, int seg); int copyinstrfrom(const void *src, void *dst, size_t len, size_t *copied, int seg); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index b7f990962ff6..cbf9b0080bf8 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2917,7 +2917,10 @@ vm_map_lookup_done(vm_map_t map, vm_map_entry_t entry) vm_map_unlock_read(map); } +#ifdef ENABLE_VFS_IOOPT /* + * Experimental support for zero-copy I/O + * * Implement uiomove with VM operations. This handles (and collateral changes) * support every combination of source object modification, and COW type * operations. @@ -3149,6 +3152,7 @@ vm_uiomove( } return 0; } +#endif /* * Performs the copy_on_write operations necessary to allow the virtual copies diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index 8156682ce999..0b8777768255 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -300,11 +300,13 @@ int vm_map_submap (vm_map_t, vm_offset_t, vm_offset_t, vm_map_t); int vm_map_madvise (vm_map_t, vm_offset_t, vm_offset_t, int); void vm_map_simplify_entry (vm_map_t, vm_map_entry_t); void vm_init2 (void); -int vm_uiomove (vm_map_t, vm_object_t, off_t, int, vm_offset_t, int *); void vm_freeze_copyopts (vm_object_t, vm_pindex_t, vm_pindex_t); int vm_map_stack (vm_map_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); int vm_map_growstack (struct proc *p, vm_offset_t addr); int vmspace_swap_count (struct vmspace *vmspace); +#ifdef ENABLE_VFS_IOOPT /* Experimental support for zero-copy I/O */ +int vm_uiomove(vm_map_t, vm_object_t, off_t, int, vm_offset_t, int *); +#endif #endif /* _KERNEL */ #endif /* _VM_MAP_ */