Page MenuHomeFreeBSD

Implement posix_fallocate(2) by fo_fspacectl.
Needs ReviewPublic

Authored by khng on Feb 21 2021, 8:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 8:48 AM
Unknown Object (File)
Fri, Nov 8, 7:32 AM
Unknown Object (File)
Fri, Nov 8, 7:25 AM
Unknown Object (File)
Fri, Nov 8, 5:52 AM
Unknown Object (File)
Wed, Oct 23, 9:34 AM
Unknown Object (File)
Oct 5 2024, 4:27 AM
Unknown Object (File)
Oct 3 2024, 6:19 PM
Unknown Object (File)
Oct 3 2024, 3:13 PM

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 Passed
Unit
No Test Coverage
Build Status
Buildable 38616
Build 35505: 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
70

...argument within the file system space.

73

...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