search for: sh_can_cache

Displaying 13 results from an estimated 13 matches for "sh_can_cache".

2019 May 10
0
[nbdkit PATCH 6/9] sh: Implement .cache script callback
...(true). + =back =head2 Missing callbacks diff --git a/plugins/sh/sh.c b/plugins/sh/sh.c index a5beb57..7aded44 100644 --- a/plugins/sh/sh.c +++ b/plugins/sh/sh.c @@ -578,6 +578,12 @@ sh_can_multi_conn (void *handle) return boolean_method (handle, "can_multi_conn"); } +static int +sh_can_cache (void *handle) +{ + return boolean_method (handle, "can_cache"); +} + static int sh_flush (void *handle, uint32_t flags) { @@ -782,6 +788,38 @@ sh_extents (void *handle, uint32_t count, uint64_t offset, uint32_t flags, } } +static int +sh_cache (void *handle, uint32_t count, uint...
2019 May 16
0
[nbdkit PATCH v2 07/24] sh: Implement .cache script callback
...62be21 100644 --- a/plugins/sh/sh.c +++ b/plugins/sh/sh.c @@ -578,6 +578,53 @@ sh_can_multi_conn (void *handle) return boolean_method (handle, "can_multi_conn"); } +/* Not a boolean method, the method prints "none", "emulate" or "native". */ +static int +sh_can_cache (void *handle) +{ + char *h = handle; + const char *args[] = { script, "can_cache", h, NULL }; + CLEANUP_FREE char *s = NULL; + size_t slen; + int r; + + switch (call_read (&s, &slen, args)) { + case OK: + if (slen > 0 && s[slen-1] == '\n') + s[sl...
2020 Sep 21
0
[nbdkit PATCH v3 06/14] api: Add .export_description
...e, - .can_flush = sh_can_flush, - .is_rotational = sh_is_rotational, - .can_trim = sh_can_trim, - .can_zero = sh_can_zero, - .can_extents = sh_can_extents, - .can_fua = sh_can_fua, - .can_multi_conn = sh_can_multi_conn, - .can_cache = sh_can_cache, - .can_fast_zero = sh_can_fast_zero, + .export_description = sh_export_description, + .get_size = sh_get_size, + .can_write = sh_can_write, + .can_flush = sh_can_flush, + .is_rotational = sh_is_rotational, + .can_trim = sh_can_trim, + .can_zer...
2019 Aug 23
2
[nbdkit PATCH 3/3] plugins: Add .can_fast_zero hook
...sh_can_multi_conn (void *handle) { - return boolean_method (handle, "can_multi_conn"); + return boolean_method (handle, "can_multi_conn", 0); } /* Not a boolean method, the method prints "none", "emulate" or "native". */ @@ -696,6 +699,21 @@ sh_can_cache (void *handle) } } +static int +sh_can_fast_zero (void *handle) +{ + int r = boolean_method (handle, "can_fast_zero", 2); + if (r < 2) + return r; + /* We need to duplicate the logic of plugins.c: if can_fast_zero is + * missing, we advertise fast fail support when can_zer...
2020 Mar 19
0
[nbdkit PATCH 1/2] sh, eval: Cache .can_zero and .can_flush
...fua"; const char *script = get_script (method); - char *h = handle; - const char *args[] = { script, method, h, NULL }; + struct sh_handle *h = handle; + const char *args[] = { script, method, h->h, NULL }; CLEANUP_FREE char *s = NULL; size_t slen; int r; @@ -562,8 +590,8 @@ sh_can_cache (void *handle) { const char *method = "can_cache"; const char *script = get_script (method); - char *h = handle; - const char *args[] = { script, method, h, NULL }; + struct sh_handle *h = handle; + const char *args[] = { script, method, h->h, NULL }; CLEANUP_FREE char *s...
2020 May 19
1
[PATCH nbdkit] common/include: Add locale-safe ascii_strcasecmp and ascii_strncasecmp.
...;) == 0) r = NBDKIT_FUA_EMULATE; - else if (strcasecmp (s, "native") == 0) + else if (ascii_strcasecmp (s, "native") == 0) r = NBDKIT_FUA_NATIVE; else { nbdkit_error ("%s: could not parse output from %s method: %s", @@ -600,11 +601,11 @@ sh_can_cache (void *handle) case OK: if (slen > 0 && s[slen-1] == '\n') s[slen-1] = '\0'; - if (strcasecmp (s, "none") == 0) + if (ascii_strcasecmp (s, "none") == 0) r = NBDKIT_CACHE_NONE; - else if (strcasecmp (s, "emulate"...
2019 May 10
11
[nbdkit PATCH 0/9] RFC: implement NBD_CMD_CACHE
I'm still working my way through the filters before this series will be complete, but this is enough of a start to at least get some feedback on the idea of implementing another NBD protocol extension. Eric Blake (9): server: Internal hooks for implementing NBD_CMD_CACHE plugins: Add .cache callback file, split: Implement .cache with posix_fadvise nbd: Implement NBD_CMD_CACHE
2020 Mar 19
5
[nbdkit PATCH 0/2] More caching of initial setup
When I added .can_FOO caching in 1.16, I missed the case that the sh plugin itself was calling .can_flush twice in some situations (in order to default .can_fua). Then right after, I regressed it to call .can_zero twice (in order to default .can_fast_zero). I also missed that .thread_model could use better caching, because at the time, I did not add testsuite coverage. Fix that now. Eric Blake
2020 Feb 10
17
Cross-project NBD extension proposal: NBD_INFO_INIT_STATE
I will be following up to this email with four separate threads each addressed to the appropriate single list, with proposed changes to: - the NBD protocol - qemu: both server and client - libnbd: client - nbdkit: server The feature in question adds a new optional NBD_INFO_ packet to the NBD_OPT_GO portion of handshake, adding up to 16 bits of information that the server can advertise to the
2020 Aug 27
10
[nbdkit PATCH v2 0/8] exportname filter
This is a revision of my .default_export work, plus new work on .export_descriptions and a new exportname filter. I think it is now ready to check in. Things I'd still like in 1.22: - the file plugin should implement .list_exports (patch already posted, but it needs rebasing on this series) - the ext2 filter should override .list_exports when in exportname mode - the nbd plugin should be
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by improving libnbd to better test things, which in turn surfaced some major memory leak problems in nbdsh that are now fixed). Many of the patches are minor rebases from v2, with the biggest changes being fallout from: - patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export - overall: this missed 1.22, so update
2019 May 16
27
[nbdkit PATCH v2 00/24] implement NBD_CMD_CACHE
Since v1: - rework .can_cache to be tri-state, with default of no advertisement (ripple effect through other patches) - add a lot more patches in order to round out filter support And in the meantime, Rich pushed NBD_CMD_CACHE support into libnbd, so in theory we now have a way to test cache commands through the entire stack. Eric Blake (24): server: Internal hooks for implementing
2019 Aug 23
22
cross-project patches: Add NBD Fast Zero support
This is a cover letter to a series of patches being proposed in tandem to four different projects: - nbd: Document a new NBD_CMD_FLAG_FAST_ZERO command flag - qemu: Implement the flag for both clients and server - libnbd: Implement the flag for clients - nbdkit: Implement the flag for servers, including the nbd passthrough client If you want to test the patches together, I've pushed a