Displaying 3 results from an estimated 3 matches for "iso_close".
2020 Apr 09
0
[PATCH nbdkit v2 2/3] iso: Implement this plugin using fileops (read-only).
...descriptor. */
+ fd = dup (iso_fd);
+ if (fd == -1) {
+ nbdkit_error ("dup: %m");
+ free (fops);
+ return NULL;
+ }
+
+ if (init_fileops (fd, fops) == -1) {
+ free (fops);
+ return 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) {
-...
2020 Apr 09
2
Re: [PATCH nbdkit v2 2/3] iso: Implement this plugin using fileops (read-only).
...quot;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.
Looks good.
--
Eric Blake, Principal Sof...
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.