UVN_ATTACH(9)

πŸ“¦ in nixpkgs unstable

πŸ’… 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 🌈


πŸ’Œ 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