Displaying 3 results from an estimated 3 matches for "fileops_read_write_callbacks".
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.
2020 Apr 09
0
[PATCH nbdkit v2 1/3] file: Move file operators to a new common/fileops mini-library.
...implementing callbacks such as .zero and .trim efficiently.
+ *
+ * To use it:
+ *
+ * - your plugin must define and use NBDKIT_API_VERSION == 2
+ *
+ * - your plugin per-connection handle must either have type ‘struct
+ * fileops *’, or include ‘struct fileops’ as the first member
+ *
+ * - add FILEOPS_READ_WRITE_CALLBACKS or
+ * FILEOPS_READ_ONLY_CALLBACKS to your ‘struct nbdkit_plugin’
+ *
+ * - call init_fileops from your .open callback, and close_fileops
+ * from your .close callback
+ *
+ * - optionally call fileops_dump_plugin from your .dump_plugin
+ * callback if you have one
+ *
+ * - the fileops mini-...
2020 Apr 09
0
[PATCH nbdkit v2 3/3] tmpdisk: Implement this plugin using fileops.
....pread = tmpdisk_pread,
- .pwrite = tmpdisk_pwrite,
- .flush = tmpdisk_flush,
- .trim = tmpdisk_trim,
+ .can_multi_conn = tmpdisk_can_multi_conn,
- .errno_is_preserved = 1,
+ /* Data serving is implemented in common/fileops/fileops.c */
+ FILEOPS_READ_WRITE_CALLBACKS
};
NBDKIT_REGISTER_PLUGIN(plugin)
--
2.25.0