diff options
author | mdf <mdf@FreeBSD.org> | 2011-04-18 16:32:22 +0000 |
---|---|---|
committer | mdf <mdf@FreeBSD.org> | 2011-04-18 16:32:22 +0000 |
commit | 9c9a32d97b41ab9d0cae56c7e428ad6d5cd1302f (patch) | |
tree | 99ab3d40a9311d51c78c3b3e6b880d6ba7d2560c /sys/compat | |
parent | 0bbb5b8e1ab919b4d265f1857ccd42679a2cb39c (diff) | |
download | FreeBSD-src-9c9a32d97b41ab9d0cae56c7e428ad6d5cd1302f.zip FreeBSD-src-9c9a32d97b41ab9d0cae56c7e428ad6d5cd1302f.tar.gz |
Add the posix_fallocate(2) syscall. The default implementation in
vop_stdallocate() is filesystem agnostic and will run as slow as a
read/write loop in userspace; however, it serves to correctly
implement the functionality for filesystems that do not implement a
VOP_ALLOCATE.
Note that __FreeBSD_version was already bumped today to 900036 for any
ports which would like to use this function.
Also reserve space in the syscall table for posix_fadvise(2).
Reviewed by: -arch (previous version)
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/freebsd32/freebsd32_misc.c | 12 | ||||
-rw-r--r-- | sys/compat/freebsd32/syscalls.master | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 5772c0e..23985d3 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2790,3 +2790,15 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap) bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname)); return (copyout(&stat32, uap->stat, version)); } + +int +freebsd32_posix_fallocate(struct thread *td, + struct freebsd32_posix_fallocate_args *uap) +{ + struct posix_fallocate_args ap; + + ap.fd = uap->fd; + ap.offset = (uap->offsetlo | ((off_t)uap->offsethi << 32)); + ap.len = (uap->lenlo | ((off_t)uap->lenhi << 32)); + return (posix_fallocate(td, &ap)); +} diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index da42133..d524f3c 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -986,3 +986,7 @@ 529 AUE_NULL NOPROTO { int rctl_remove_rule(const void *inbufp, \ size_t inbuflen, void *outbufp, \ size_t outbuflen); } +530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\ + uint32_t offsetlo, uint32_t offsethi,\ + uint32_t lenlo, uint32_t lenhi); } +531 AUE_NULL UNIMPL posix_fadvise |