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
buf_allocbuf_attrbuf_bawritebuf_bdwritebuf_biodonebuf_biowaitbuf_blknobuf_breadbuf_breadnbuf_brelsebuf_bwritebuf_callbackbuf_clearbuf_clear_redundancy_flagsbuf_clearflagsbuf_clonebuf_countbuf_dataptrbuf_devicebuf_dirtyendbuf_dirtyoffbuf_drvdatabuf_errorbuf_flagsbuf_flushdirtyblksbuf_freebuf_fromcachebuf_fsprivatebuf_fuabuf_getblkbuf_geteblkbuf_invalblknobuf_invalidateblksbuf_iteratebuf_lblknobuf_mapbuf_markagedbuf_markcleanbuf_markdelayedbuf_markeintrbuf_markfuabuf_markinvalidbuf_markstaticbuf_meta_breadbuf_meta_breadnbuf_procbuf_rcredbuf_redundancy_flagsbuf_resetbuf_residbuf_set_redundancy_flagsbuf_setblknobuf_setcallbackbuf_setcountbuf_setdataptrbuf_setdevicebuf_setdirtyendbuf_setdirtyoffbuf_setdrvdatabuf_seterrorbuf_setflagsbuf_setfsprivatebuf_setlblknobuf_setresidbuf_setsizebuf_setuplbuf_setvnodebuf_shadowbuf_sizebuf_staticbuf_strategybuf_unmapbuf_uplbuf_uploffsetbuf_validbuf_vnodebuf_wcredbufattr_ioscheduledbufattr_markioscheduled