search for: nbd_unlocked_read_only

Displaying 12 results from an estimated 12 matches for "nbd_unlocked_read_only".

2019 Aug 06
0
[PATCH libnbd 1/3] api: Change nbd_read_only -> nbd_is_read_only.
..._read_only", { default_call with args = []; ret = RBool; permitted_states = [ Connected; Closed ]; diff --git a/lib/flags.c b/lib/flags.c index cdbc28f..2bcacb8 100644 --- a/lib/flags.c +++ b/lib/flags.c @@ -65,7 +65,7 @@ get_flag (struct nbd_handle *h, uint16_t flag) } int -nbd_unlocked_read_only (struct nbd_handle *h) +nbd_unlocked_is_read_only (struct nbd_handle *h) { return get_flag (h, NBD_FLAG_READ_ONLY); } diff --git a/lib/rw.c b/lib/rw.c index bba62be..50ba23d 100644 --- a/lib/rw.c +++ b/lib/rw.c @@ -341,7 +341,7 @@ nbd_unlocked_aio_pwrite_callback (struct nbd_handle *h, const v...
2019 May 22
0
[libnbd PATCH v3 1/7] lib: Refactor command_common() to do more common work
...buf, 0, NULL); } int64_t @@ -322,8 +320,6 @@ nbd_unlocked_aio_pwrite (struct nbd_connection *conn, const void *buf, size_t count, uint64_t offset, uint32_t flags) { - struct command_in_flight *cmd; - if (nbd_unlocked_read_only (conn->h) == 1) { set_error (EINVAL, "server does not support write operations"); return -1; @@ -340,33 +336,20 @@ nbd_unlocked_aio_pwrite (struct nbd_connection *conn, const void *buf, return -1; } - cmd = command_common (conn, flags, NBD_CMD_WRITE, offset, count,...
2019 Aug 06
5
[PATCH libnbd 0/3] One API and small documentation changes.
One API change, some small documentation changes.
2019 Jul 16
1
[libnbd PATCH] generator: Prefer closure opaque after function pointer in C
...callback, + callback_fn callback, void *user_data, uint32_t flags) { - struct command_cb cb = { .user_data = user_data, .callback = callback, }; + struct command_cb cb = { .callback = callback, .user_data = user_data, }; if (nbd_unlocked_read_only (h) == 1) { set_error (EINVAL, "server does not support write operations"); @@ -355,10 +354,10 @@ nbd_unlocked_aio_flush (struct nbd_handle *h, uint32_t flags) } int64_t -nbd_unlocked_aio_flush_callback (struct nbd_handle *h, void *user_data, - call...
2019 Jun 29
0
[libnbd PATCH 5/6] api: Add new nbd_aio_FOO_notify functions
...4_t +nbd_unlocked_aio_pwrite_notify (struct nbd_handle *h, const void *buf, + size_t count, uint64_t offset, + void *opaque, notify_fn notify, uint32_t flags) +{ + struct command_cb cb = { .opaque = opaque, .notify = notify, }; + if (nbd_unlocked_read_only (h) == 1) { set_error (EINVAL, "server does not support write operations"); return -1; @@ -306,12 +339,21 @@ nbd_unlocked_aio_pwrite (struct nbd_handle *h, const void *buf, } return nbd_internal_command_common (h, flags, NBD_CMD_WRITE, offset, count, -...
2019 Aug 03
1
[PATCH libnbd] generator: Generate typedefs automatically for Closure arguments.
...etion_callback completion, + void *user_data, uint32_t flags) { - struct command_cb cb = { .callback = callback, .user_data = user_data, }; + struct command_cb cb = { .completion = completion, .user_data = user_data, }; if (nbd_unlocked_read_only (h) == 1) { set_error (EINVAL, "server does not support write operations"); @@ -358,10 +362,12 @@ nbd_unlocked_aio_flush (struct nbd_handle *h, uint32_t flags) } int64_t -nbd_unlocked_aio_flush_callback (struct nbd_handle *h, callback_fn callback, -...
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 May 22
12
[libnbd PATCH v3 0/7] Avoid deadlock with in-flight commands
Since v2: - rebase to Rich's new API calls - more refactoring in patch 1 (retitled) - new patches 3 and 4 - fix data corruption in patch 6 (was 4) - more tweaks to the reproducer example (including using new API from 3) Eric Blake (7): lib: Refactor command_common() to do more common work commands: Allow for a command queue commands: Expose FIFO ordering of server completions
2019 Jul 16
0
[PATCH libnbd v2] generator: Define new Closure type instead of callbacks.
...k_fn callback, + void *user_data, callback_fn callback, uint32_t flags) { - struct command_cb cb = { .opaque = opaque, .callback = callback, }; + struct command_cb cb = { .user_data = user_data, .callback = callback, }; if (nbd_unlocked_read_only (h) == 1) { set_error (EINVAL, "server does not support write operations"); @@ -352,10 +355,10 @@ nbd_unlocked_aio_flush (struct nbd_handle *h, uint32_t flags) } int64_t -nbd_unlocked_aio_flush_callback (struct nbd_handle *h, void *opaque, +nbd_unlocked_aio_flush_callback (struct...
2019 May 23
2
[PATCH libnbd] api: Get rid of nbd_connection.
This isn't quite finished because not all of the tests or examples have been updated, but it demonstrates an idea: Should we forget about the concept of having multiple connections managed under a single handle? In this patch there is a single ‘struct nbd_handle *’ which manages a single state machine and connection (and therefore no nbd_connection). To connect to a multi-conn server you must
2019 Jul 16
2
[PATCH libnbd v2] generator: Define new Closure type
As before, but this one has working Python bindings. OCaml still TBD. Rich.
2019 Jun 29
19
[libnbd PATCH 0/6] new APIs: aio_in_flight, aio_FOO_notify
I still need to wire in the use of *_notify functions into nbdkit to prove whether it makes the code any faster or easier to maintain, but at least the added example shows one good use case for the new API. Eric Blake (6): api: Add nbd_aio_in_flight generator: Allow DEAD state actions to run generator: Allow Int64 in callbacks states: Prepare for aio notify callback api: Add new