search for: iso_get_size

Displaying 7 results from an estimated 7 matches for "iso_get_size".

2019 Jan 05
0
[PATCH nbdkit v2 06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins.
...size = floppy_get_size, + .can_multi_conn = floppy_can_multi_conn, .pread = floppy_pread, .errno_is_preserved = 1, }; diff --git a/plugins/iso/iso.c b/plugins/iso/iso.c index 7ed5e7a..7431b48 100644 --- a/plugins/iso/iso.c +++ b/plugins/iso/iso.c @@ -258,6 +258,13 @@ iso_get_size (void *handle) return statbuf.st_size; } +/* Serves the same data over multiple connections. */ +static int +iso_can_multi_conn (void *handle) +{ + return 1; +} + /* Read data from the file. */ static int iso_pread (void *handle, void *buf, uint32_t count, uint64_t offset) @@ -291,6 +298,...
2020 Apr 09
0
[PATCH nbdkit v2 2/3] iso: Implement this plugin using fileops (read-only).
...urn NULL; + } + + return fops; +} + +/* Free up the per-connection handle. */ +static void +iso_close (void *handle) +{ + struct fileops *fops = handle; + + close_fileops (fops); + free (fops); } #define THREAD_MODEL NBDKIT_THREAD_MODEL_PARALLEL -/* Get the file size. */ -static int64_t -iso_get_size (void *handle) -{ - struct stat statbuf; - - if (fstat (fd, &statbuf) == -1) { - nbdkit_error ("fstat: %m"); - return -1; - } - - return statbuf.st_size; -} - /* Serves the same data over multiple connections. */ static int iso_can_multi_conn (void *handle) @@ -219,35 +23...
2020 Apr 09
2
Re: [PATCH nbdkit v2 2/3] iso: Implement this plugin using fileops (read-only).
...;iso", > .longname = "nbdkit iso plugin", > @@ -259,11 +250,11 @@ static struct nbdkit_plugin plugin = { > .magic_config_key = "dir", > .get_ready = iso_get_ready, > .open = iso_open, > - .get_size = iso_get_size, > + .close = iso_close, > .can_multi_conn = iso_can_multi_conn, Part of me wondered if .can_multi_conn be set for all read-only clients, but without making it mandatory on read-write clients. But I'm fine with keeping it as something the plugin must do itself. Lo...
2019 Jan 05
15
[PATCH nbdkit v2 01/11] server: Implement NBD_FLAG_CAN_MULTI_CONN.
For existing commits, this is almost identical to v1, except that I updated some commit messages and reordered the commits in a somewhat more logical sequence. The main changes are the extra commits: [06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins. - Readonly plugins that can set the flag unconditionally. [09/11] partitioning: Return NBD_FLAG_CAN_MULTI_CONN. [10/11]
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 Feb 25
6
[PATCH nbdkit 0/5] server: Add .get_ready callback.
I like this change. I think we were overloading the config_complete method before to do two different things (complete configuration; do any allocation/housekeeping necessary before we can start serving). The only questions in my mind are whether we want this before 1.18, and whether the name ("get_ready") is a good one. Rich.
2019 May 16
27
[nbdkit PATCH v2 00/24] implement NBD_CMD_CACHE
Since v1: - rework .can_cache to be tri-state, with default of no advertisement (ripple effect through other patches) - add a lot more patches in order to round out filter support And in the meantime, Rich pushed NBD_CMD_CACHE support into libnbd, so in theory we now have a way to test cache commands through the entire stack. Eric Blake (24): server: Internal hooks for implementing