VOP_REMOVE(9)
π VOP_REMOVE(9) β the Kernel Developer's Manual, bestie edition π
okay so welcome to the Kernel Developer's Manual, specifically the page about yeeting files and directories out of existence. this is VOP_REMOVE, and its partner in crime VOP_RMDIR. they're literally the "delete" buttons of the vnode world. no cap.
β¨ NAME β¨
VOP_REMOVE, VOP_RMDIR β remove a file or directory ποΈβ¨
like, one of them removes a file, the other removes a directory, and honestly? iconic behavior.
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/vnode.h>
int
VOP_REMOVE(struct vnode *dvp, struct vnode *vp,
struct componentname *cnp);
int
VOP_RMDIR(struct vnode *dvp, struct vnode *vp,
struct componentname *cnp);
these are the exact signatures, don't come for me, copy them character for character bestie π
π¦ DESCRIPTION π¦
so these entry points remove files and directories respectively. that's it. that's the vibe. VOP_REMOVE handles files, VOP_RMDIR handles directories, and they both take the same three arguments.
the arguments are:
dvpβ the vnode of the directory π (the parent, the one holding the door open)vpβ the vnode of the file to be removed πΈ (the one getting evicted)cnpβ pathname information about the file π (all the name-y details)
π LOCKS π
both dvp and vp should be locked on entry and remain locked on return. like, they walk in locked, they walk out locked. no unlocking on the way through, periodt. π
β RETURN VALUES β
zero is returned on success π₯³ otherwise an error code is returned π β that's the whole deal.
π ERRORS π
[EPERM]β the file is immutable. it said "not today", bestie, it cannot be changed or removed π[ENOTEMPTY]β an attempt was made to remove a directory which is not empty. you can't just rmdir a folder full of stuff, the folder is giving "I have attachments" energy π
π SEE ALSO π
go read those too, iykyk π«Ά
π AUTHORS π
this manual page was written by Doug Rabson. thank you Doug, you ate π₯
and that's the whole page, babes β this little beauty came from the Debian crowd and it's dated July 24, 1996, which is honestly vintage in the most iconic way πβ¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 1996 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms