Contents

buf_iterate

Perform some operation on all buffers associated with a vnode.

Declaration

void buf_iterate(vnode_t vp, int (*callout)(buf_t, void *), int flags, void *arg);

Parameters

  • vp:

    The vnode whose buffers to scan.

  • callout:

    Function to call on each buffer. Should return one of: BUF_RETURNED: buf_iterate() should call buf_brelse() on the buffer. BUF_RETURNED_DONE: buf_iterate() should call buf_brelse() on the buffer and then stop iterating. BUF_CLAIMED: buf_iterate() should continue iterating (and not call buf_brelse()). BUF_CLAIMED_DONE: buf_iterate() should stop iterating (and not call buf_brelse()).

  • flag:

    BUF_SKIP_NONLOCKED: Skip buffers which are not busy when we encounter them. BUF_SKIP_LOCKED: Skip buffers which are busy when we encounter them. BUF_SCAN_CLEAN: Call out on clean buffers. BUF_SCAN_DIRTY: Call out on dirty buffers. BUF_NOTIFY_BUSY: If a buffer cannot be acquired, pass a NULL buffer to callout; otherwise, that buffer will be silently skipped.

  • arg:

    Argument to pass to callout in addition to buffer.

Return Value

void.

See Also

Buffers