VOP_ALLOCATE(9)
β¨ VOP_ALLOCATE β¨
okay bestie, welcome to VOP_ALLOCATE β it's a section 9 kernel developer manual page, and it's literally the vibe of "please make room for my file, I'm begging you." π
πΈ 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);
π DESCRIPTION π
so this call allocates storage for a range of offsets in a file. that's it, that's the whole job. it's the backend that makes the posix_fallocate system call happen, no cap. π₯
its arguments are, and listen closely because there are exactly three:
vpβ the vnode of the file. the file in question, the main character. πoffsetβ the start of the range to allocate storage for in the file.lenβ the length of the range to allocate storage for in the file.
the offset and len arguments get updated to reflect the portion of the range that still needs to be allocated on return. and here's the tea: a partial allocation is considered a successful operation. so if it only got halfway, that's still a win, bestie, we take those. π
also very important, the file's contents are not changed. we're just booking the space, not writing anything. it's giving "reserving the table, not ordering the food." π
π LOCKS π
the file should be exclusively locked on entry and will still be locked on exit. so you hold the lock the whole way through, no letting go mid-hug. π«Ά
π« RETURN VALUES π«
zero is returned if the call is successful. otherwise an appropriate error code is returned. zero = slay, anything else = read the next section. π
π ERRORS π
[EFBIG]β an attempt was made to write a file that exceeds the process's file size limit or the maximum file size. too big, girl. π[ENOSPC]β the file system is full. no room, the club is at capacity, bouncer said no. π«[EPERM]β an append-only flag is set on the file, but the caller is attempting to write before the current end of file. the file said "append only" and you tried to go backwards, and that's not the move. π
π SEE ALSO π
vnode(9), VOP_READ(9), VOP_WRITE(9)
and that's the whole page, bestie π this one's from the Debian crew, dated October 3, 2013 β so yeah, it's been serving correct allocation energy since way before you got here. periodt. β¨π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2013 Hudson River Trading LLC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms