search for: nbd_cmd_flush

Displaying 20 results from an estimated 81 matches for "nbd_cmd_flush".

2017 Nov 15
1
[nbdkit PATCH] connections: Improve error responses
...nbdkit_error ("invalid request: data request is too large (%" PRIu32 " > %d)", count, MAX_REQUEST_SIZE); *error = ENOMEM; - return 0; - } - - /* Readonly connection? */ - if (conn->readonly && - (cmd == NBD_CMD_WRITE || cmd == NBD_CMD_FLUSH || - cmd == NBD_CMD_TRIM || cmd == NBD_CMD_WRITE_ZEROES)) { - nbdkit_error ("invalid request: write request on readonly connection"); - *error = EROFS; - return 0; + return false; } /* Flush allowed? */ if (!conn->can_flush && cmd == NBD_CMD_FLUSH) {...
2019 May 25
1
[nbdkit PATCH] nbd: Rewrite thread passing to use semaphore rather than pipe
...n c < 0 ? c : nbd_reply (h, c); + return s ? nbd_reply (h, s) : -1; } /* Flush the file to disk. */ @@ -1233,11 +1233,11 @@ static int nbd_flush (void *handle, uint32_t flags) { struct handle *h = handle; - int c; + struct transaction *s; assert (!flags); - c = nbd_request (h, 0, NBD_CMD_FLUSH, 0, 0); - return c < 0 ? c : nbd_reply (h, c); + s = nbd_request (h, 0, NBD_CMD_FLUSH, 0, 0); + return s ? nbd_reply (h, s) : -1; } /* Read extents of the file. */ @@ -1246,13 +1246,13 @@ nbd_extents (void *handle, uint32_t count, uint64_t offset, uint32_t flags, struct nbdki...
2019 May 22
0
[libnbd PATCH v3 1/7] lib: Refactor command_common() to do more common work
...NULL); } int64_t nbd_unlocked_aio_flush (struct nbd_connection *conn) { - struct command_in_flight *cmd; - if (nbd_unlocked_can_flush (conn->h) != 1) { set_error (EINVAL, "server does not support flush operations"); return -1; } - cmd = command_common (conn, 0, NBD_CMD_FLUSH, 0, 0, NULL); - if (!cmd) - return -1; - if (nbd_internal_run (conn->h, conn, cmd_issue) == -1) - return -1; - - return cmd->handle; + return nbd_internal_command_common (conn, 0, NBD_CMD_FLUSH, 0, 0, + NULL, 0, NULL); } int64_t @@ -374,8 +357...
2020 Sep 11
0
[libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...count, + return nbd_internal_command_common (h, flags, NBD_CMD_READ, offset, count, buf, &cb); } @@ -350,7 +350,7 @@ nbd_unlocked_aio_flush (struct nbd_handle *h, } SET_CALLBACK_TO_NULL (*completion); - return nbd_internal_command_common (h, 0, NBD_CMD_FLUSH, 0, 0, + return nbd_internal_command_common (h, flags, NBD_CMD_FLUSH, 0, 0, NULL, &cb); } @@ -409,7 +409,7 @@ nbd_unlocked_aio_cache (struct nbd_handle *h, } SET_CALLBACK_TO_NULL (*completion); - return nbd_internal_command_common (h, 0, NBD_CMD...
2019 Jan 04
10
[PATCH nbdkit 0/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
...ts NBD_FLAG_CAN_MULTI_CONN, described in the protocol doc as: "NBD_FLAG_CAN_MULTI_CONN: Indicates that the server operates entirely without cache, or that the cache it uses is shared among all connections to the given device. In particular, if this flag is present, then the effects of NBD_CMD_FLUSH and NBD_CMD_FLAG_FUA MUST be visible across all connections when the server sends its reply to that command to the client. In the absence of this flag, clients SHOULD NOT multiplex their commands over more than one connection to the export." This is necessary to support the Linux nbd...
2018 Jan 18
1
Re: [PATCH 9/9] filters: Move rdelay/wdelay from file plugin to new delay filter.
...gt; lacks FUA support. And maybe we want a flush delay to mirror the > existing rdelay and wdelay (simulating a long flush time can indeed be > useful in tests); where it definitely matters whether the flush delay is > triggered as part of FUA fallback, or only triggered on an actual > NBD_CMD_FLUSH from the client. > > I'm also thinking ahead to expansions - for example, there are proposals > to add resize and block status commands to NBD. In your implementation, > if a filter does not define .can_flush or .flush, then its .can_flush > implementation merely returns whatev...
2018 Dec 06
10
[PATCH nbdkit 0/5] protocol: Generate map functions from NBD protocol flags to printable strings.
With some crufty sed scripts we can generate functions that map from NBD protocol flags (eg. NBD_CMD_READ) to strings ("NBD_CMD_READ"). This works on GNU sed and with FreeBSD, also with GNU sed's --posix option, so I guess the sed code is POSIX-compatible. Rich.
2019 Jan 04
0
Re: [PATCH nbdkit 0/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
...scribed in the protocol doc > as: > > "NBD_FLAG_CAN_MULTI_CONN: Indicates that the server operates > entirely without cache, or that the cache it uses is shared among > all connections to the given device. In particular, if this flag is > present, then the effects of NBD_CMD_FLUSH and NBD_CMD_FLAG_FUA MUST > be visible across all connections when the server sends its reply to > that command to the client. In the absence of this flag, clients > SHOULD NOT multiplex their commands over more than one connection to > the export." > > This is neces...
2018 Jan 17
4
Re: [PATCH 9/9] filters: Move rdelay/wdelay from file plugin to new delay filter.
On 01/17/2018 02:53 PM, Richard W.M. Jones wrote: > Previously the file plugin supported ‘rdelay’ and ‘wdelay’ parameters > for injecting delays (for testing) into read and write requests. This > moves the functionality to a new delay filter so that it can be used > with any plugin. > --- > +/* Write data. */ > +static int > +delay_pwrite (struct nbdkit_next *next, void
2020 Aug 05
5
Re: More parallelism in VDDK driver (was: Re: CFME-5.11.7.3 Perf. Tests)
...ssible, but also that they are come with certain guarantees: bit 8, NBD_FLAG_CAN_MULTI_CONN: Indicates that the server operates entirely without cache, or that the cache it uses is shared among all connections to the given device. In particular, if this flag is present, then the effects of NBD_CMD_FLUSH and NBD_CMD_FLAG_FUA MUST be visible across all connections when the server sends its reply to that command to the client. In the absence of this flag, clients SHOULD NOT multiplex their commands over more than one connection to the export. “--shared” limits the number of connections that...
2020 Sep 17
2
Re: [libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...ommon (h, flags, NBD_CMD_READ, offset, count, > buf, &cb); > } > > @@ -350,7 +350,7 @@ nbd_unlocked_aio_flush (struct nbd_handle *h, > } > > SET_CALLBACK_TO_NULL (*completion); > - return nbd_internal_command_common (h, 0, NBD_CMD_FLUSH, 0, 0, > + return nbd_internal_command_common (h, flags, NBD_CMD_FLUSH, 0, 0, > NULL, &cb); > } > > @@ -409,7 +409,7 @@ nbd_unlocked_aio_cache (struct nbd_handle *h, > } > > SET_CALLBACK_TO_NULL (*completion); > - retu...
2018 Jan 16
9
[nbdkit PATCH 0/7] Initial implementation of FUA flag passthrough
Tested via: term1$ qemu-nbd -k $PWD/sock -t -f raw -x foo junk --trace=nbd_\* term2$ ./nbdkit -f -v -e bar nbd socket=$PWD/sock export=foo term3$ qemu-io -t none -f raw nbd://localhost:10809/bar --trace=nbd_\* and checking the traces to see that 'w 0 1' vs. 'w -f 0 1' was able to influence whether the FUA flag showed up at the server in term1. Still to go: figure out how to
2019 May 22
0
[libnbd PATCH v2 1/5] lib: Refactor state event into command_common
...const void *buf, (void *) buf); if (!cmd) return -1; - if (nbd_internal_run (conn->h, conn, cmd_issue) == -1) - return -1; return cmd->handle; } @@ -363,8 +361,6 @@ nbd_unlocked_aio_flush (struct nbd_connection *conn) cmd = command_common (conn, 0, NBD_CMD_FLUSH, 0, 0, NULL); if (!cmd) return -1; - if (nbd_internal_run (conn->h, conn, cmd_issue) == -1) - return -1; return cmd->handle; } @@ -400,8 +396,6 @@ nbd_unlocked_aio_trim (struct nbd_connection *conn, cmd = command_common (conn, flags, NBD_CMD_TRIM, offset, count, NULL);...
2018 Jan 18
0
Re: [PATCH 9/9] filters: Move rdelay/wdelay from file plugin to new delay filter.
...done at the layer that lacks FUA support. And maybe we want a flush delay to mirror the existing rdelay and wdelay (simulating a long flush time can indeed be useful in tests); where it definitely matters whether the flush delay is triggered as part of FUA fallback, or only triggered on an actual NBD_CMD_FLUSH from the client. I'm also thinking ahead to expansions - for example, there are proposals to add resize and block status commands to NBD. In your implementation, if a filter does not define .can_flush or .flush, then its .can_flush implementation merely returns whatever the underlying backend...
2017 Jan 20
7
[nbdkit PATCH 0/5] Add WRITE_ZEROES support
The upstream protocol recently promoted NBD_CMD_WRITE_ZEROES from experimental to a documented extension. Exposing support for this allows plugin writers to create sparse files when driven by a client that knows how to use the extension; meanwhile, even if a plugin does not support this extension, the server benefits from less network traffic from the client. Eric Blake (5): protocol: Support
2020 Aug 05
0
Re: More parallelism in VDDK driver (was: Re: CFME-5.11.7.3 Perf. Tests)
...e come > with certain guarantees: > > bit 8, NBD_FLAG_CAN_MULTI_CONN: Indicates that the server operates > entirely without cache, or that the cache it uses is shared among > all connections to the given device. In particular, if this flag is > present, then the effects of NBD_CMD_FLUSH and NBD_CMD_FLAG_FUA MUST > be visible across all connections when the server sends its reply to > that command to the client. In the absence of this flag, clients > SHOULD NOT multiplex their commands over more than one connection to > the export. > > “--shared” limits th...
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...quot; - "offset=%" PRIu64 " count=%" PRIu32, - name_of_nbd_cmd (cmd), offset, count); - *error = (cmd == NBD_CMD_WRITE || - cmd == NBD_CMD_WRITE_ZEROES) ? ENOSPC : EINVAL; - return false; - } - break; - - case NBD_CMD_FLUSH: - if (offset != 0 || count != 0) { - nbdkit_error ("invalid request: %s: expecting offset and count = 0", - name_of_nbd_cmd (cmd)); - *error = EINVAL; - return false; - } - break; - - default: - nbdkit_error ("invalid request: unknown c...
2020 Sep 11
0
[libnbd PATCH v2 5/5] api: Add STRICT_BOUNDS/ZERO_SIZE to nbd_set_strict_mode
...(void *) buf, &cb); + ENOSPC, (void *) buf, &cb); } int64_t @@ -351,7 +365,7 @@ nbd_unlocked_aio_flush (struct nbd_handle *h, SET_CALLBACK_TO_NULL (*completion); return nbd_internal_command_common (h, flags, NBD_CMD_FLUSH, 0, 0, - NULL, &cb); + 0, NULL, &cb); } int64_t @@ -379,14 +393,9 @@ nbd_unlocked_aio_trim (struct nbd_handle *h, } } - if (count == 0) { /* NBD protocol forbids this. */ - set_error (EINVA...
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
...t;invalid request: FUA flag not supported"); + *error = EINVAL; + return false; + } } /* Refuse over-large read and write requests. */ @@ -159,35 +168,51 @@ validate_request (struct connection *conn, } /* Flush allowed? */ - if (!conn->can_flush && cmd == NBD_CMD_FLUSH) { - nbdkit_error ("invalid request: %s: flush operation not supported", - name_of_nbd_cmd (cmd)); - *error = EINVAL; - return false; + if (cmd == NBD_CMD_FLUSH) { + r = backend_can_flush (backend, conn); + assert (r >= 0); /* Guaranteed by eflags compu...
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status implementation. While the patches (especially the second one) are very large they are really just elementary code motion. Rich.