search for: nbd_trim

Displaying 20 results from an estimated 58 matches for "nbd_trim".

2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...io_trim", { @@ -2152,9 +2232,10 @@ To check if the command completed, call L<nbd_aio_command_completed(3)>. Or supply the optional C<completion_callback> which will be invoked as described in L<libnbd(3)/Completion callbacks>. -Other parameters behave as documented in L<nbd_trim(3)>."; +Other parameters behave as documented in L<nbd_trim(3)>." +^ strict_call_description; see_also = [SectionLink "Issuing asynchronous commands"; - Link "can_trim"; Link "trim"]; + Link "can_trim"; Li...
2019 Aug 14
3
[libnbd PATCH 0/2] Drop generated file from git
Rich recently patched things to generate one man page per function rather than libnbd-api.3 (nice), but in doing so got stumped by a problem with a fresh git clone (automake fails for any 'include' directive that does not already exist). I've figured out how to hack around it, but the hack requires GNU make. We already use GNU make constructs elsewhere (such as $(wildcard)), but
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...E, "nbd_aio_pwrite: "); - /* Use unadvertised command */ + /* Use unadvertised command, client-side */ + strict |= LIBNBD_STRICT_COMMANDS; + if (nbd_set_strict_mode (nbd, strict) == -1) { + fprintf (stderr, "%s\n", nbd_get_error ()); + exit (EXIT_FAILURE); + } + if (nbd_trim (nbd, 512, 0, 0) != -1) { + fprintf (stderr, "%s: test failed: " + "unpermitted nbd_trim did not fail\n", + argv[0]); + exit (EXIT_FAILURE); + } + check (EINVAL, "nbd_trim: "); + /* Use unadvertised command, server-side */ + strict &am...
2020 Sep 04
4
[RFC libnbd PATCH 0/2] Add knobs for client- vs. server-side validation
We have been inconsistent on how much we reject client-side without even consulting the server, vs. how much we depend on the server to detect failure (even if our request can be deemed undefined per NBD protocol). I'd like to change it so that by default, we reject as much as we can client-side for less traffic, but where the user can also change things on the fly for server-side integration
2019 Jun 29
0
[libnbd PATCH 5/6] api: Add new nbd_aio_FOO_notify functions
...4,8 +1919,37 @@ in C<nbd_flush>."; Issue a trim command to the NBD server. This returns the unique positive 64 bit handle for this command, or C<-1> on error. To check if the command completed, call -C<nbd_aio_command_completed>. Parameters behave as documented -in C<nbd_trim>."; +C<nbd_aio_command_completed>, or use C<nbd_aio_trim_notify>. +Parameters behave as documented in C<nbd_trim>."; + }; + + "aio_trim_notify", { + default_call with + args = [ UInt64 "count"; UInt64 "offset"; + Opaqu...
2019 Jul 30
3
[PATCH libnbd] lib: Remove cookie parameter from completion callbacks.
...kie, then C<callback> +error. + +When the command completes, C<callback> will be invoked as described in L<libnbd(3)/Completion callbacks>. + Other parameters behave as documented in C<nbd_flush>."; }; @@ -1891,7 +1902,7 @@ Parameters behave as documented in C<nbd_trim>."; default_call with args = [ UInt64 "count"; UInt64 "offset"; Closure { cbname="callback"; - cbargs=[Int64 "cookie"; Mutable (Int "error")]}; + cbargs=[Mutable (Int "...
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 Aug 14
0
[libnbd PATCH 2/2] docs: Drop docs/Makefile.inc from git
...d \ - nbd_is_read_only \ - nbd_can_flush \ - nbd_can_fua \ - nbd_is_rotational \ - nbd_can_trim \ - nbd_can_zero \ - nbd_can_df \ - nbd_can_multi_conn \ - nbd_can_cache \ - nbd_can_meta_context \ - nbd_get_size \ - nbd_pread \ - nbd_pread_structured \ - nbd_pwrite \ - nbd_shutdown \ - nbd_flush \ - nbd_trim \ - nbd_cache \ - nbd_zero \ - nbd_block_status \ - nbd_poll \ - nbd_aio_connect \ - nbd_aio_connect_uri \ - nbd_aio_connect_unix \ - nbd_aio_connect_tcp \ - nbd_aio_connect_command \ - nbd_aio_pread \ - nbd_aio_pread_structured \ - nbd_aio_pwrite \ - nbd_aio_disconnect \ - nbd_aio_flush \ - nbd_ai...
2019 Aug 15
1
[PATCH libnbd] docs: Change docs/Makefile.inc back to a regular include, readd to git.
...d \ + nbd_is_read_only \ + nbd_can_flush \ + nbd_can_fua \ + nbd_is_rotational \ + nbd_can_trim \ + nbd_can_zero \ + nbd_can_df \ + nbd_can_multi_conn \ + nbd_can_cache \ + nbd_can_meta_context \ + nbd_get_size \ + nbd_pread \ + nbd_pread_structured \ + nbd_pwrite \ + nbd_shutdown \ + nbd_flush \ + nbd_trim \ + nbd_cache \ + nbd_zero \ + nbd_block_status \ + nbd_poll \ + nbd_aio_connect \ + nbd_aio_connect_uri \ + nbd_aio_connect_unix \ + nbd_aio_connect_tcp \ + nbd_aio_connect_command \ + nbd_aio_pread \ + nbd_aio_pread_structured \ + nbd_aio_pwrite \ + nbd_aio_disconnect \ + nbd_aio_flush \ + nbd_ai...
2020 Sep 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
In v2: - now based on my proposal to add LIBNBD_SHUTDOWN_IMMEDIATE - four flags instead of two: STRICT_FLAGS is new (patch 4), and STRICT_BOUNDS is separate from STRICT_ZERO_SIZE (patch 5) - various refactorings for more shared code and less duplication Eric Blake (5): api: Add xxx_MASK constant for each Flags type generator: Refactor filtering of accepted OFlags api: Add
2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...t" ]; - optargs = [ OFlags "flags" ]; + optargs = [ OFlags ("flags", cmd_flags) ]; ret = RInt64; permitted_states = [ Connected ]; shortdesc = "send trim command to the NBD server"; @@ -1959,7 +1975,7 @@ Parameters behave as documented in C<nbd_trim>."; args = [ UInt64 "count"; UInt64 "offset"; Closure { cbname="completion"; cbargs=[CBMutable (Int "error")] } ]; - optargs = [ OFlags "flags" ]; + optargs = [ OFlags ("flags", cmd_...
2019 Aug 13
0
[PATCH libnbd 6/6] lib: Make all completion callbacks into OClosures.
...optargs = [ OClosure completion_closure; OFlags ("flags", cmd_flags) ]; ret = RInt64; permitted_states = [ Connected ]; shortdesc = "send flush command to the NBD server, with callback on completion"; @@ -1999,8 +1996,8 @@ Parameters behave as documented in C<nbd_trim>."; "aio_trim_callback", { default_call with - args = [ UInt64 "count"; UInt64 "offset"; Closure completion_closure ]; - optargs = [ OFlags ("flags", cmd_flags) ]; + args = [ UInt64 "count"; UInt64 "offset" ]; +...
2019 Aug 13
0
[PATCH libnbd 1/6] generator: Share single list of all Closures.
...uot;; - cbargs=[CBMutable (Int "error")] } ]; + args = [ Closure completion_closure ]; optargs = [ OFlags ("flags", cmd_flags) ]; ret = RInt64; permitted_states = [ Connected ]; @@ -1994,9 +1998,7 @@ Parameters behave as documented in C<nbd_trim>."; "aio_trim_callback", { default_call with - args = [ UInt64 "count"; UInt64 "offset"; - Closure { cbname="completion"; - cbargs=[CBMutable (Int "error")] } ]; + args = [ UInt64 "count...
2019 Aug 13
0
[PATCH libnbd v2 2/3] lib: Make all completion callbacks into OClosures.
...optargs = [ OClosure completion_closure; OFlags ("flags", cmd_flags) ]; ret = RInt64; permitted_states = [ Connected ]; shortdesc = "send flush command to the NBD server, with callback on completion"; @@ -1999,8 +1996,8 @@ Parameters behave as documented in C<nbd_trim>."; "aio_trim_callback", { default_call with - args = [ UInt64 "count"; UInt64 "offset"; Closure completion_closure ]; - optargs = [ OFlags ("flags", cmd_flags) ]; + args = [ UInt64 "count"; UInt64 "offset" ]; +...
2019 May 25
1
[nbdkit PATCH] nbd: Rewrite thread passing to use semaphore rather than pipe
...BD_CMD_FLAG_FUA; - c = nbd_request (h, f, NBD_CMD_WRITE_ZEROES, offset, count); - return c < 0 ? c : nbd_reply (h, c); + s = nbd_request (h, f, NBD_CMD_WRITE_ZEROES, offset, count); + return s ? nbd_reply (h, s) : -1; } /* Trim a portion of the file. */ @@ -1220,12 +1220,12 @@ static int nbd_trim (void *handle, uint32_t count, uint64_t offset, uint32_t flags) { struct handle *h = handle; - int c; + struct transaction *s; assert (!(flags & ~NBDKIT_FLAG_FUA)); - c = nbd_request (h, flags & NBDKIT_FLAG_FUA ? NBD_CMD_FLAG_FUA : 0, + s = nbd_request (h, flags & NBDKIT_FLA...
2017 Nov 14
0
[nbdkit PATCH v2 1/2] nbd: Add new nbd forwarding plugin
...EROES)) { + /* Trigger a fall back to regular writing */ + errno = EOPNOTSUPP; + return -1; + } + + if (!may_trim) + cmd |= NBD_CMD_FLAG_NO_HOLE; + c = nbd_request (h, cmd, offset, count); + return c < 0 ? c : nbd_reply (h, c); +} + +/* Trim a portion of the file. */ +static int +nbd_trim (void *handle, uint32_t count, uint64_t offset) +{ + struct handle *h = handle; + int c; + + c = nbd_request (h, NBD_CMD_TRIM, offset, count); + return c < 0 ? c : nbd_reply (h, c); +} + +/* Flush the file to disk. */ +static int +nbd_flush (void *handle) +{ + struct handle *h = handle; +...
2019 Jul 23
4
[libnbd PATCH] api: Allow completion callbacks to auto-retire
...s command, or C<-1> on error. If this command returns a cookie, then C<callback> will be called when the server is done replying, although you must still use C<nbd_aio_command_completed> after -the callback to retire the command. Other parameters behave as -documented in C<nbd_trim>. +the callback to retire the command unless the callback returns C<1>. +Other parameters behave as documented in C<nbd_trim>. The C<callback> function is called with the same C<user_data> passed to this function, C<cookie> set to the return value of this functio...
2019 May 28
0
[PATCH] api: Add a special type for the flags argument.
..."count"; UInt64 "offset"; UInt32 "flags" ]; + args = [ UInt64 "count"; UInt64 "offset"; Flags "flags" ]; ret = RInt64; shortdesc = "send trim to the NBD server"; longdesc = "\ @@ -1551,7 +1552,7 @@ in C<nbd_trim>."; "aio_cache", { default_call with - args = [ UInt64 "count"; UInt64 "offset"; UInt32 "flags" ]; + args = [ UInt64 "count"; UInt64 "offset"; Flags "flags" ]; ret = RInt64; shortdesc = "sen...
2017 Nov 12
6
[nbdkit PATCH] nbd: Add new nbd forwarding plugin
...Trigger a fall back to writing */ + errno = EOPNOTSUPP; + return -1; + } + + if (!may_trim) + cmd |= NBD_CMD_FLAG_NO_HOLE; + if (nbd_request (h, cmd, offset, count, &cookie) < 0) + return -1; + return nbd_reply (h, cookie); +} + +/* Trim a portion of the file. */ +static int +nbd_trim (void *handle, uint32_t count, uint64_t offset) +{ + struct handle *h = handle; + uint64_t cookie; + + if (nbd_request (h, NBD_CMD_TRIM, offset, count, &cookie) < 0) + return -1; + return nbd_reply (h, cookie); +} + +/* Flush the file to disk. */ +static int +nbd_flush (void *handle)...
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
..."\ -Issue a trim command to the NBD server. This returns the -unique positive 64 bit cookie for this command, or C<-1> on -error. To check if the command completed, call -C<nbd_aio_command_completed>, or use C<nbd_aio_trim_callback>. -Parameters behave as documented in C<nbd_trim>."; - }; - - "aio_trim_callback", { default_call with args = [ UInt64 "count"; UInt64 "offset" ]; optargs = [ OClosure completion_closure; OFlags ("flags", cmd_flags) ]; ret = RInt64; permitted_states = [ Connected ]; - s...