search for: aio_pread_structur

Displaying 20 results from an estimated 31 matches for "aio_pread_structur".

Did you mean: aio_pread_structured
2019 Aug 14
4
[libnbd PATCH 0/2] Fix test 505
Rich found that I had been using bogus logic, but it was hidden by other bugs in our language bindings until recently. Eric Blake (2): python: Fix test 505 ocaml: Fix test 505 python/t/505-aio-pread-callback.py | 14 +++++++------- .../test_505_aio_pread_structured_callback.ml | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) -- 2.20.1
2019 Aug 14
0
[libnbd PATCH 2/2] ocaml: Fix test 505
...uires that !err be 0; if chunk had actually failed, !err should be non-zero. We're overloading a single user_data int to try and control two orthogonal things (what to expect in err, and whether to fail); let's instead make the callback user_data a tuple. Fixes: ce0f2126 --- .../test_505_aio_pread_structured_callback.ml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ocaml/tests/test_505_aio_pread_structured_callback.ml b/ocaml/tests/test_505_aio_pread_structured_callback.ml index 075ec85..433dc27 100644 --- a/ocaml/tests/test_505_aio_pread_structured_callback....
2020 Sep 11
0
[libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...supported - some servers cannot do this, see L<nbd_can_df(3)>). Libnbd does not validate that the server -actually obeys the flag."; +actually obeys the flag." +^ strict_call_description; see_also = [Link "can_df"; Link "pread"; - Link "aio_pread_structured"; Link "get_block_size"]; + Link "aio_pread_structured"; Link "get_block_size"; + Link "set_strict_mode"]; }; "pwrite", { @@ -2123,10 +2149,12 @@ Or supply the optional C<completion_callback> which w...
2020 Sep 17
2
Re: [libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...ot do > this, see L<nbd_can_df(3)>). Libnbd does not validate that the server > -actually obeys the flag."; > +actually obeys the flag." > +^ strict_call_description; > see_also = [Link "can_df"; Link "pread"; > - Link "aio_pread_structured"; Link "get_block_size"]; > + Link "aio_pread_structured"; Link "get_block_size"; > + Link "set_strict_mode"]; > }; > > "pwrite", { > @@ -2123,10 +2149,12 @@ Or supply the optional C<c...
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...ctured-reads.c | 6 +- examples/threaded-reads-and-writes.c | 4 +- generator/generator | 184 ++++-------------- lib/rw.c | 139 ++++--------- ocaml/examples/asynch_copy.ml | 4 +- .../test_505_aio_pread_structured_callback.ml | 8 +- ocaml/tests/test_590_aio_copy.ml | 4 +- python/t/505-aio-pread-callback.py | 24 +-- python/t/510-aio-pwrite.py | 2 +- tests/aio-parallel-load.c | 4 +- tests/aio-parallel.c |...
2019 Aug 13
2
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
This applies on top of the OClosure v2 series posted a few minutes ago. Rich.
2019 Jul 17
0
Re: [PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
...FOO command based on its cookie. That solves the race for the callback ever being fired before the user has had a chance to track the cookie, and makes it so that only one command has to register callback functions (rather than one counterpart per aio_FOO command). Or maybe even three parts: nbd_aio_pread_structured() => creates cookie, called once nbd_aio_add_callback(cookie, callback, user_data) - called 0 or more times before submit; callbacks run in LIFO order at command completion nbd_aio_submit(cookie) => kicks off the command Why do it this way? Because in the Python bindings, right now we ha...
2019 Jul 17
2
Re: [PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
On 7/17/19 8:00 AM, Richard W.M. Jones wrote: > --- > .gitignore | 1 + > README | 2 + > configure.ac | 9 + > examples/Makefile.am | 22 ++ > examples/glib-main-loop.c | 511 ++++++++++++++++++++++++++++++++++++++ > 5 files changed, 545 insertions(+) Looks good. > > + revents = g_source_query_unix_fd
2020 Jul 24
4
[libnbd PATCH 0/3] Expose server block size constraints
Necessary when writing a client that wants to avoid unnecessary EINVAL errors from sending unaligned requests. At some point, we may want to add synchronous convenience API wrappers that do request splitting or read-modify-write to obey server constraints while still appearing to the library client as accepting any possible request. But such a wrapper should only be synchronous and not copied to
2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
...lock_status", (1, 0); + "poll", (1, 0); + "aio_connect", (1, 0); + "aio_connect_uri", (1, 0); + "aio_connect_unix", (1, 0); + "aio_connect_tcp", (1, 0); + "aio_connect_command", (1, 0); + "aio_pread", (1, 0); + "aio_pread_structured", (1, 0); + "aio_pwrite", (1, 0); + "aio_disconnect", (1, 0); + "aio_flush", (1, 0); + "aio_trim", (1, 0); + "aio_cache", (1, 0); + "aio_zero", (1, 0); + "aio_block_status", (1, 0); + "aio_get_fd", (1, 0)...
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 Sep 05
3
[PATCH libnbd] generator: Move first_version fields to a single table.
This doesn't include Eric's new APIs, but if you push those then I can rebase this one on top. Rich.
2019 Aug 13
0
[PATCH libnbd 1/6] generator: Share single list of all Closures.
...nt "error")] } ]; + Closure completion_closure ]; optargs = [ OFlags ("flags", cmd_flags) ]; ret = RInt64; permitted_states = [ Connected ]; @@ -1841,11 +1856,7 @@ completed. Other parameters behave as documented in C<nbd_pread>."; "aio_pread_structured", { default_call with args = [ BytesPersistOut ("buf", "count"); UInt64 "offset"; - Closure { cbname="chunk"; - cbargs=[CBBytesIn ("subbuf", "count"); - CBUIn...
2019 Jun 21
0
[libnbd PATCH v2 3/5] states: Add nbd_pread_structured API
...+the entire request. The C<flags> parameter must be C<0> for now (it exists for future NBD protocol extensions)."; @@ -1591,6 +1663,26 @@ C<buf> is valid until the command has completed. Other parameters behave as documented in C<nbd_pread>."; }; + "aio_pread_structured", { + default_call with + args = [ BytesPersistOut ("buf", "count"); UInt64 "offset"; + Opaque "data"; + CallbackPersist ("chunk", [ Opaque "data"; + BytesIn (&qu...
2019 Jun 29
0
[libnbd PATCH 5/6] api: Add new nbd_aio_FOO_notify functions
...ll status of the command by storing into +C<error> and returning C<-1>, although attempts to undo non-zero +status back to zero are ignored. The callback cannot call C<nbd_*> +APIs on the same handle since it holds the handle lock and will +cause a deadlock."; }; "aio_pread_structured", { @@ -1730,8 +1761,43 @@ parameters behave as documented in C<nbd_pread>."; Issue a read 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_comple...
2019 Jul 16
2
[PATCH libnbd] generator: Define new Closure type
** INCOMPLETE ** This is the generator change as discussed on the list already. The Python and OCaml bindings are not yet done. It passes all [C only] tests and valgrind. Note that nbd_add_close_callback is inconsistent with other closure types because it passes the user_data parameter after the function. (This is not caused by the current patch, it was already inconsistent). We decided that
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
...39; is the best approach or most idiomatic OCaml - but hey, it taught me a lot about OCaml. Writing a 'string * callback list' proved to be a rather interesting exercise] Our C code has a couple of functions that want to take multiple callback functions that share a single opaque data (nbd_aio_pread_structured_callback; nbd_aio_block_status_callback). However, the mapping of this construct to Python passed only the opaque handle of the first function to the second callback wrapper, which means we would invoke the wrong Python Callable; better is tracking a single malloc()d structure containing the Pyth...
2019 Jul 24
0
[PATCH libnbd 2/3] lib: Implement closure lifetimes.
...Closure { cbname="callback"; + cbargs=[Int64 "cookie"; Mutable (Int "error")] }; Flags "flags" ]; ret = RInt64; permitted_states = [ Connected ]; @@ -1755,12 +1748,11 @@ cause a deadlock."; "aio_pread_structured", { default_call with args = [ BytesPersistOut ("buf", "count"); UInt64 "offset"; - Closure (true, - { cbname="chunk"; - cbargs=[BytesIn ("subbuf", "count"); -...
2019 Jul 16
3
[RFC libnbd PATCH 0/2] Start fixing python nbd.pread_structured_callback
Posting now that I got something to compile (at the expense of breaking OCaml bindings), but I'm open to ideas on how to improve it. Eric Blake (2): generator: Tweak print_c_arg_list to take alternate first arg RFC: generator: Handle shared callbacks in Python generator/generator | 556 ++++++++++++++++++++++---------------------- 1 file changed, 280 insertions(+), 276 deletions(-) --
2019 Jul 24
0
[PATCH libnbd v2 2/5] lib: Implement closure lifetimes.
...Closure { cbname="callback"; + cbargs=[Int64 "cookie"; Mutable (Int "error")] }; Flags "flags" ]; ret = RInt64; permitted_states = [ Connected ]; @@ -1755,12 +1748,11 @@ cause a deadlock."; "aio_pread_structured", { default_call with args = [ BytesPersistOut ("buf", "count"); UInt64 "offset"; - Closure (true, - { cbname="chunk"; - cbargs=[BytesIn ("subbuf", "count"); -...