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/freebsd32/freebsd32_misc.c | |
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/freebsd32/freebsd32_misc.c')
-rw-r--r-- | sys/compat/freebsd32/freebsd32_misc.c | 12 |
1 files changed, 12 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)); +} |