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, Mar 16, 10:43 PM
Unknown Object (File)
Feb 10 2024, 6:03 PM
Unknown Object (File)
Feb 1 2024, 4:17 AM
Unknown Object (File)
Jan 30 2024, 6:40 AM
Unknown Object (File)
Dec 20 2023, 8:13 AM
Unknown Object (File)
Dec 12 2023, 12:24 AM
Unknown Object (File)
Nov 18 2023, 2:16 PM
Unknown Object (File)
Nov 10 2023, 4:01 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 37246
Build 34135: 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