VOP_ALLOCATE(9)
okay bestie, welcome to the VOP_ALLOCATE(9) glow-up π
this page is from the Kernel Developer's Manual, section 9, and it's giving βallocate storage for a fileβ energy. no cap, we're gonna go through every lil detail together. π«Ά
β¨ NAME β¨
VOP_ALLOCATE β allocate storage for a file πΎβ¨
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/vnode.h>
int
VOP_ALLOCATE(struct vnode *vp, off_t *offset, off_t *len, int ioflag,
struct ucred *cred);
π DESCRIPTION π
This call allocates storage for a range of offsets in a file. It is used to implement the posix_fallocate(2) system call. literally the whole vibe is reserving space in a file, and the file's contents are not changed. π
Its arguments are:
vpβ The vnode of the file. the main character vnode, honestly. πoffsetβ The start of the range to allocate storage for in the file. where the storage party begins. πlenβ The length of the range to allocate storage for in the file. how long the storage party goes. πioflagβ Directives and hints to be given to the file system. lil instructions for the fs bestie. π«‘credβ The credentials of the caller. who's asking, basically. πͺͺ
The offset and len arguments are updated to reflect the portion of the range that still needs to be allocated on return. A partial allocation is considered a successful operation. The file's contents are not changed. periodt. π
π LOCKS π
The file should be exclusively locked on entry and will still be locked on exit. no sneaky lock drops here, bestie. π
π«Ά RETURN VALUES π«Ά
Zero is returned if the call is successful, otherwise an appropriate error code is returned. slay if it's zero; if not, bestie check the error. π
π ERRORS π
[EFBIG]β An attempt was made to write a file that exceeds the process's file size limit or the maximum file size. π[ENOSPC]β The file system is full. no room, no vibes. π[EPERM]β An append-only flag is set on the file, but the caller is attempting to write before the current end of file. permission said absolutely not. π
π SEE ALSO π
go read these next, iykyk. πβ¨
π that's the whole page, bestie. it's from Debian, dated November 8, 2021, and it's the VOP_ALLOCATE(9) manual page. mwah π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2013 Hudson River Trading LLC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms