Page MenuHomeFreeBSD

Implement posix_fallocate(2) by fo_fspacectl.
Needs ReviewPublic

Authored by khng on Feb 21 2021, 8:33 AM.

Details

Reviewers
delphij
markj
lwhsu
kib
gbe
Group Reviewers
manpages
Summary

fspacectl(2)'s cmd parameter supports SPACECTL_ALLOC besides
SPACECTL_DEALLOC in this commit. posix_fallocate(2) is implemented with
fo_fspacectl under the hood.

VOP_ALLOCATE(9) is expanded to have an extra flags and cred parameters.

uipc_shm and NFS client/server are converted to use the new
VOP_ALLOCATE(9) prototype.

struct fileops::fo_fallocate is eliminated.

Submitted by: Ka Ho Ng <khng@freebsdfoundation.org>
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 37235
Build 34124: arc lint + arc unit

Event Timeline

khng requested review of this revision.Feb 21 2021, 8:33 AM

Rebased on top of the newest D27194.

nfsvno_allocate: Use cred from argument instead of td_ucred.

Two small nits from manpages.

lib/libc/sys/fspacectl.2
66

...argument within the file system space.

69

...for a non-hole region.

Some fixes suggested by gbe@, with one more sentence explaining SPACECTL_ALLOC.

khng marked 2 inline comments as done.Mar 4 2021, 8:46 AM

STYLE: normalizing date format to: February 8, 2021

This revision is now accepted and ready to land.Mar 4 2021, 5:41 PM

Rebased and fixed manpage.

This revision now requires review to proceed.Mar 18 2021, 7:50 PM

Moved the following into this revision:

	/* Translate to posix_fallocate(2) return value as needed. */
	if (error == ENOMEM)
		error = ENOSPC;

Compilation fixes after rebase