Displaying 20 results from an estimated 50 matches for "nbd_cache".
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
2019 Jun 29
0
[libnbd PATCH 5/6] api: Add new nbd_aio_FOO_notify functions
...@@ in C<nbd_trim>.";
Issue the cache (prefetch) 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_cache>.";
+C<nbd_aio_command_completed>, or use C<nbd_aio_cache_notify>.
+Parameters behave as documented in C<nbd_cache>.";
+ };
+
+ "aio_cache_notify", {
+ default_call with
+ args = [ UInt64 "count"; UInt64 "offset";
+ Op...
2019 Jul 30
3
[PATCH libnbd] lib: Remove cookie parameter from completion callbacks.
...okie, 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_trim>.";
};
@@ -1922,7 +1936,7 @@ Parameters behave as documented in C<nbd_cache>.";
default_call with
args = [ UInt64 "count"; UInt64 "offset";
Closure { cbname="callback";
- cbargs=[Int64 "cookie"; Mutable (Int "error")]};
+ cbargs=[Mutable (Int "...
2019 Aug 14
0
[libnbd PATCH 2/2] docs: Drop docs/Makefile.inc from git
...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_aio_trim \
- nbd...
2019 Aug 15
1
[PATCH libnbd] docs: Change docs/Makefile.inc back to a regular include, readd to git.
...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_aio_trim \
+ nbd...
2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...optargs = [ OFlags "flags" ];
+ optargs = [ OFlags ("flags", cmd_flags) ];
ret = RInt64;
permitted_states = [ Connected ];
shortdesc = "send cache (prefetch) command to the NBD server";
@@ -1994,7 +2010,7 @@ Parameters behave as documented in C<nbd_cache>.";
args = [ UInt64 "count"; UInt64 "offset";
Closure { cbname="completion";
cbargs=[CBMutable (Int "error")] } ];
- optargs = [ OFlags "flags" ];
+ optargs = [ OFlags ("flags", cmd_...
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...o_cache", {
@@ -2172,9 +2253,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_cache(3)>.";
+Other parameters behave as documented in L<nbd_cache(3)>."
+^ strict_call_description;
see_also = [SectionLink "Issuing asynchronous commands";
- Link "can_cache"; Link "cache"];
+ Link "can_cache"...
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 trim command to the NBD server, with callback on completion";
@@ -2032,8 +2029,8 @@ Parameters behave as documented in C<nbd_cache>.";
"aio_cache_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.
..."error")] } ];
+ args = [ UInt64 "count"; UInt64 "offset"; Closure completion_closure ];
optargs = [ OFlags ("flags", cmd_flags) ];
ret = RInt64;
permitted_states = [ Connected ];
@@ -2029,9 +2031,7 @@ Parameters behave as documented in C<nbd_cache>.";
"aio_cache_callback", {
default_call with
- args = [ UInt64 "count"; UInt64 "offset";
- Closure { cbname="completion";
- cbargs=[CBMutable (Int "error")] } ];
+ args = [ UInt64 "coun...
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 trim command to the NBD server, with callback on completion";
@@ -2032,8 +2029,8 @@ Parameters behave as documented in C<nbd_cache>.";
"aio_cache_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
...EQ_ONE ? NBD_CMD_FLAG_REQ_ONE : 0,
NBD_CMD_BLOCK_STATUS, offset, count, NULL, NULL,
extents);
- return c < 0 ? c : nbd_reply (h, c);
+ return s ? nbd_reply (h, s) : -1;
}
/* Cache a portion of the file. */
@@ -1260,11 +1260,11 @@ static int
nbd_cache (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
{
struct handle *h = handle;
- int c;
+ struct transaction *s;
assert (!flags);
- c = nbd_request (h, 0, NBD_CMD_CACHE, offset, count);
- return c < 0 ? c : nbd_reply (h, c);
+ s = nbd_request (h, 0, NBD_CMD_CACHE, offs...
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_cache>.
+the callback to retire the command unless the callback returns C<1>.
+Other parameters behave as documented in C<nbd_cache>.
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 functi...
2019 May 28
0
[PATCH] api: Add a special type for the flags argument.
..."; UInt64 "offset"; UInt32 "flags" ];
+ args = [ UInt64 "count"; UInt64 "offset"; Flags "flags" ];
ret = RInt64;
shortdesc = "send cache (prefetch) to the NBD server";
longdesc = "\
@@ -1564,7 +1565,7 @@ in C<nbd_cache>.";
"aio_zero", {
default_call with
- args = [ UInt64 "count"; UInt64 "offset"; UInt32 "flags" ];
+ args = [ UInt64 "count"; UInt64 "offset"; Flags "flags" ];
ret = RInt64;
shortdesc = "send...
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...the cache (prefetch) 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_cache_callback>.
-Parameters behave as documented in C<nbd_cache>.";
- };
-
- "aio_cache_callback", {
default_call with
args = [ UInt64 "count"; UInt64 "offset" ];
optargs = [ OClosure completion_closure; OFlags ("flags", cmd_flags) ];
ret = RInt64;
permitted_states = [ Connected ];
-...
2019 Aug 09
0
[PATCH libnbd 2/2] generator: Change handling of Flags to be a true optional argument.
...[ UInt64 "count"; UInt64 "offset" ];
+ optargs = [ OFlags "flags" ];
ret = RInt64;
permitted_states = [ Connected ];
shortdesc = "send cache (prefetch) command to the NBD server";
@@ -1988,8 +1998,8 @@ Parameters behave as documented in C<nbd_cache>.";
default_call with
args = [ UInt64 "count"; UInt64 "offset";
Closure { cbname="completion";
- cbargs=[CBMutable (Int "error")] };
- Flags "flags" ];
+ cbargs=...
2019 Aug 06
5
[PATCH libnbd 0/3] One API and small documentation changes.
One API change, some small documentation changes.
2019 May 28
2
[PATCH] api: Add a special type for the flags argument.
This applies on top of patches 1 & 2 here (instead of patch 3):
https://www.redhat.com/archives/libguestfs/2019-May/msg00206.html
https://www.redhat.com/archives/libguestfs/2019-May/msg00207.html
Rich.
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.
2020 Mar 19
1
[nbdkit PATCH] nbd: Drop nbd-standalone fallback
...amp; h->extents);
- s = nbd_request_full (h, flags & NBDKIT_FLAG_REQ_ONE ? NBD_CMD_FLAG_REQ_ONE : 0,
- NBD_CMD_BLOCK_STATUS, offset, count, NULL, NULL,
- extents);
- return nbd_reply (h, s);
-}
-
-/* Cache a portion of the file. */
-static int
-nbd_cache (void *handle, uint32_t count, uint64_t offset, uint32_t flags)
-{
- struct handle *h = handle;
- struct transaction *s;
-
- assert (!flags);
- s = nbd_request (h, 0, NBD_CMD_CACHE, offset, count);
- return nbd_reply (h, s);
-}
-
-static struct nbdkit_plugin plugin = {
- .name =...
2019 Aug 02
0
[nbdkit PATCH v2 10/17] plugins: Add .fork_safe field
...diff --git a/plugins/nbd/nbd-standalone.c b/plugins/nbd/nbd-standalone.c
index 1468098b..4f1224c7 100644
--- a/plugins/nbd/nbd-standalone.c
+++ b/plugins/nbd/nbd-standalone.c
@@ -1365,6 +1365,7 @@ static struct nbdkit_plugin plugin = {
.extents = nbd_extents,
.cache = nbd_cache,
.errno_is_preserved = 1,
+ .fork_safe = 1, /* no use of fork() */
};
NBDKIT_REGISTER_PLUGIN (plugin)
diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c
index 95d910e7..7762c9c0 100644
--- a/plugins/nbd/nbd.c
+++ b/plugins/nbd/nbd.c
@@ -861,6 +861,7 @@ static struct nbdkit_plugin pl...