MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bufmallocadjust

Function bufmallocadjust

freebsd/kern/vfs_bio.c:864–877  ·  view source on GitHub ↗

* bufmallocadjust: * * Adjust the reported bufspace for a malloc managed buffer, possibly * waking any waiters. */

Source from the content-addressed store, hash-verified

862 * waking any waiters.
863 */
864static void
865bufmallocadjust(struct buf *bp, int bufsize)
866{
867 int diff;
868
869 KASSERT((bp->b_flags & B_MALLOC) != 0,
870 ("bufmallocadjust: non-malloc buf %p", bp));
871 diff = bufsize - bp->b_bufsize;
872 if (diff < 0)
873 atomic_subtract_long(&bufmallocspace, -diff);
874 else
875 atomic_add_long(&bufmallocspace, diff);
876 bp->b_bufsize = bufsize;
877}
878
879/*
880 * runningwakeup:

Callers 2

vfs_nonvmio_truncateFunction · 0.85
vfs_nonvmio_extendFunction · 0.85

Calls 2

atomic_subtract_longFunction · 0.85
atomic_add_longFunction · 0.85

Tested by

no test coverage detected