VNODE_PAGER_PURGE_RANGE(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’… VNODE_PAGER_PURGE_RANGE(9) πŸ’…

okay bestie, this one is from the Kernel Developer’s Manual, and it’s all about telling the vnode pager to ✨purge✨ a byte range. no cap, it’s niche but iconic.


🌸 NAME 🌸

vnode_pager_purge_range β€” invalidate the cached content within the given byte range


✨ SYNOPSIS ✨

#include <sys/param.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>

void
vnode_pager_purge_range(struct vnode *vp, vm_ooffset_t start,
    vm_ooffset_t end);

πŸ¦‹ DESCRIPTION πŸ¦‹

so vnode_pager_purge_range invalidates the cached content inside the given byte range from the specified vnode vp. the range getting purged is [start, end), periodt.

if the end parameter is the value zero, then the affected range starts from start and continues all the way to the end of the object. yes bestie, zero means β€œto the end” here, iykyk.

pages within the specified range will be removed from the object’s queue. if start or end is not aligned to a page boundary, the invalidated part of the page is zeroed. πŸ’…

this function only cleans the resident pages in the affected region β€” it is up to the callers to ensure reading the backing store gets back zeroes. so like, don’t expect this function to handle the whole zero situation for you, fr fr.

in case the vnode vp does not have a VM object allocated, the effect of calling this function is a no-op. literally nothing happens. 🫢


πŸ”’ LOCKS πŸ”’

the vnode must be locked on entry and will still be locked on exit. so it goes in locked and comes out locked β€” main character energy, no drama. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


πŸŽ€ HISTORY πŸŽ€

the vnode_pager_purge_range manual page first appeared in FreeBSD 14. slay. 🌈


πŸ’– AUTHORS πŸ’–

this manual page was written by Ka Ho Ng <khng@FreeBSD.org>. give them their flowers bestie. 🌸


Debian Β· April 24, 2022 β€” that’s the source/version and date, and this page is officially signed off with group-chat love. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from