]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9).
authorKa Ho Ng <khng@FreeBSD.org>
Thu, 5 Aug 2021 15:20:42 +0000 (23:20 +0800)
committerKa Ho Ng <khng@FreeBSD.org>
Thu, 5 Aug 2021 15:20:42 +0000 (23:20 +0800)
commit0dc332bff200c940edc36c4715b629a2e1e9f9ae
tree0c2995d8ed48879914d30fbc7228f0e718316fad
parentabbb57d5a647f91847a860bd25b4f109c3abb390
Add fspacectl(2), vn_deallocate(9) and VOP_DEALLOCATE(9).

fspacectl(2) is a system call to provide space management support to
userspace applications. VOP_DEALLOCATE(9) is a VOP call to perform the
deallocation. vn_deallocate(9) is a public KPI for kmods' use.

The purpose of proposing a new system call, a KPI and a VOP call is to
allow bhyve or other hypervisor monitors to emulate the behavior of SCSI
UNMAP/NVMe DEALLOCATE on a plain file.

fspacectl(2) comprises of cmd and flags parameters to specify the
space management operation to be performed. Currently cmd has to be
SPACECTL_DEALLOC, and flags has to be 0.

fo_fspacectl is added to fileops.
VOP_DEALLOCATE(9) is added as a new VOP call. A trivial implementation
of VOP_DEALLOCATE(9) is provided.

Sponsored by: The FreeBSD Foundation
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D28347
25 files changed:
lib/libc/sys/Makefile.inc
lib/libc/sys/Symbol.map
lib/libc/sys/fspacectl.2 [new file with mode: 0644]
lib/libc/sys/pathconf.2
share/man/man9/Makefile
share/man/man9/VOP_DEALLOCATE.9 [new file with mode: 0644]
share/man/man9/vn_deallocate.9 [new file with mode: 0644]
sys/bsm/audit_kevents.h
sys/compat/freebsd32/freebsd32.h
sys/compat/freebsd32/freebsd32_misc.c
sys/compat/freebsd32/syscalls.master
sys/kern/capabilities.conf
sys/kern/sys_generic.c
sys/kern/syscalls.master
sys/kern/vfs_default.c
sys/kern/vfs_vnops.c
sys/kern/vnode_if.src
sys/security/audit/audit_bsm.c
sys/sys/fcntl.h
sys/sys/file.h
sys/sys/syscallsubr.h
sys/sys/unistd.h
sys/sys/vnode.h
tests/sys/file/Makefile
tests/sys/file/fspacectl_test.c [new file with mode: 0644]