UVN_ATTACH(9)
π UVN_ATTACH(9) β memory mapping files and devices π
okay bestie, welcome to the UVN_ATTACH(9) page β yes, it's a kernel developer's manual situation, and we're gonna get through it together. no cap, it's giving βtiny but important VM lore.β π§
πΈ NAME πΈ
uvn_attach, uvm_vnp_setsize, uvm_vnp_sync, uvm_vnp_terminate, uvm_vnp_uncache β memory mapping files and devices π
β¨ SYNOPSIS β¨
#include <sys/param.h>
#include <uvm/uvm.h>
struct uvm_object *
uvn_attach(struct vnode *vp, vm_prot_t accessprot);
void
uvm_vnp_setsize(struct vnode *vp, voff_t newsize);
void
uvm_vnp_sync(struct mount *mp);
void
uvm_vnp_terminate(struct vnode *vp);
boolean_t
uvm_vnp_uncache(struct vnode *vp);
π DESCRIPTION π
okay so here's the group chat. all five functions are lowkey doing vnode/VM admin, and each one has its own lil job. π«Ά
π¦ uvn_attach()
uvn_attach() attaches a UVM object to vnode vp, creating the object if necessary. The object is returned. periodt. π
π uvm_vnp_setsize()
uvm_vnp_setsize() sets the size of vnode vp to newsize. Caller must hold a reference to the vnode. If the vnode shrinks, pages no longer used are discarded.
β οΈ heads up: this function will be removed when the file system and VM buffer caches are merged. π«
πΈ uvm_vnp_sync()
uvm_vnp_sync() flushes dirty vnodes from either the mount point passed in mp, or all dirty vnodes if mp is NULL.
β οΈ also on removal watch: this function will be removed when the file system and VM buffer caches are merged. π
π uvm_vnp_terminate()
uvm_vnp_terminate() frees all VM resources allocated to vnode vp. If the vnode still has references, it will not be destroyed; however all future operations using this vnode will fail.
that βwill failβ part is not a vibe, bestie β take it seriously. π
β οΈ removal notice: this function will be removed when the file system and VM buffer caches are merged.
π¦ uvm_vnp_uncache()
uvm_vnp_uncache() disables vnode vp from persisting when all references are freed.
β οΈ removal notice: this function will be removed when the file system and UVM caches are unified. note the wording: UVM caches are unified, not VM buffer caches. iykyk.
Returns true if there is no active vnode. β¨
π SEE ALSO π
uvm_init(9)β the linked bestie π
π cute sign-off: this page is brought to you by Debian on December 5, 2019, filed as UVN_ATTACH(9). xoxo, go map something safely π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 1998 Matthew R. Green
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms