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
F150444368: D28833.id87466.diff
Wed, Apr 1, 6:30 AM
F150444211: D28833.id84404.diff
Wed, Apr 1, 6:28 AM
F150442352: D28833.id86185.diff
Wed, Apr 1, 6:12 AM
F150442209: D28833.id87536.diff
Wed, Apr 1, 6:10 AM
F150441842: D28833.id84732.diff
Wed, Apr 1, 6:07 AM
F150439401: D28833.id85988.diff
Wed, Apr 1, 5:46 AM
F150434049: D28833.id85107.diff
Wed, Apr 1, 5:03 AM
F150433971: D28833.id85984.diff
Wed, Apr 1, 5:02 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 Passed
Unit
No Test Coverage
Build Status
Buildable 37237
Build 34126: 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
67

...argument within the file system space.

70

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