Displaying 3 results from an estimated 3 matches for "fileops_flush".
2020 Apr 09
0
[PATCH nbdkit v2 1/3] file: Move file operators to a new common/fileops mini-library.
...r FILEOPS_READ_ONLY_CALLBACKS to your
+ * ‘struct nbdkit_plugin’.
+ */
+#define FILEOPS_READ_WRITE_CALLBACKS \
+ .can_trim = fileops_can_trim, \
+ .can_fua = fileops_can_fua, \
+ .pwrite = fileops_pwrite, \
+ .flush = fileops_flush, \
+ .trim = fileops_trim, \
+ .zero = fileops_zero, \
+ FILEOPS_READ_ONLY_CALLBACKS
+
+#define FILEOPS_READ_ONLY_CALLBACKS \
+ .get_size = fileops_get_size, \
+ .can_cache = fileops_can_cache, \...
2020 Apr 09
1
[PATCH nbdkit PRELIMINARY] file: Move file operators to a new fileops mini-library
There's a lot of code in nbdkit-file-plugin which it would be nice to
reuse elsewhere. One possible approach (as outlined here) is simply
to move the file callbacks (like file.pread, file.pwrite, file.zero
etc) to a new mini-library. They can then be consumed by other
plugins fairly easily by doing:
static void *
foo_open (int readonly)
{
struct fileops *fops;
int fd, flags;
/*
2020 Apr 09
6
[PATCH nbdkit v2 0/3] Implement fileops.
Needs some work still, see in particular the commit message
for patch 3.
Rich.