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)
Sat, Dec 21, 12:04 PM
Unknown Object (File)
Fri, Dec 20, 11:13 PM
Unknown Object (File)
Thu, Dec 19, 12:19 PM
Unknown Object (File)
Sun, Dec 8, 8:51 AM
Unknown Object (File)
Thu, Nov 28, 8:14 PM
Unknown Object (File)
Nov 21 2024, 6:42 AM
Unknown Object (File)
Nov 20 2024, 10:26 AM
Unknown Object (File)
Nov 8 2024, 8:48 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 37564
Build 34453: 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