Contents

buf_create_shadow

Create a shadow buffer with optional private storage and an optional callback.

Declaration

buf_t buf_create_shadow(buf_t bp, boolean_t force_copy, uintptr_t external_storage, void (*iodone)(buf_t, void *), void *arg);

Parameters

  • bp:

    Buffer to shadow.

  • force_copy:

    If TRUE, do not link the shadaow to 'bp' and if 'external_storage' == NULL, force a copy of the data associated with 'bp'.

  • external_storage:

    If non-NULL, associate it with the new buffer as its storage instead of the storage currently associated with 'bp'.

  • iodone:

    Callback to be called from buf_biodone() when I/O completes, in the sense of buf_setcallback().

  • arg:

    Argument to pass to iodone() callback.

Return Value

NULL if the buffer to be shadowed is not B_META or a primary buffer (i.e. not a shadow buffer); otherwise, the new buffer.

See Also

Buffers