filters: Adjust callback API for flags/errors
commitb0ce44114127a40977e17fe4d30e55edf2dbf740
authorEric Blake <eblake@redhat.com>
Mon, 19 Feb 2018 21:16:01 +0000 (19 15:16 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 22 Mar 2018 12:29:47 +0000 (22 07:29 -0500)
tree30ad6439a397b8ea11be118b29285249cebdab2a
parent1c70af75470228a9b7c0013e2da03fa61f1ef500
filters: Adjust callback API for flags/errors

It's time to expose the full semantics already in use by the backend
to our filters, by exposing flags and an explicit parameter for
tracking the error value to return to the client.  This is an
incompatible API change, and all existing filters are updated to
match the new semantics.

Of note: access to flags means the cache filter can now behave
correctly in the face of FUA semantics (a FUA write must write
through, even when the cache mode is writeback, rather than
waiting for a subsequent flush).  However, more work to more
fully support FUA through the stack will come in later patches.

I considerered a possible boilerplate reduction option of having
a filter that returns -1 but does not set *err to cause
filters.c to populate *err with the current value of errno; but
for now, manually setting *err at all sites makes it obvious
how much this API change affects.

Signed-off-by: Eric Blake <eblake@redhat.com>
docs/nbdkit-filter.pod
filters/cache/cache.c
filters/cow/cow.c
filters/delay/delay.c
filters/offset/offset.c
filters/partition/partition.c
include/nbdkit-common.h
include/nbdkit-filter.h
src/filters.c
src/internal.h