search for: _pwrite_old

Displaying 10 results from an estimated 10 matches for "_pwrite_old".

2019 May 09
1
[nbdkit PATCH] plugins: Use static buffer for plugin_zeroes
...uct backend_plugin, backend); - char *buf; + static const char buf[MAX_REQUEST_SIZE]; uint32_t limit; int r = -1; bool may_trim = flags & NBDKIT_FLAG_MAY_TRIM; @@ -639,12 +639,7 @@ plugin_zero (struct backend *b, struct connection *conn, assert (p->plugin.pwrite || p->plugin._pwrite_old); flags &= ~NBDKIT_FLAG_MAY_TRIM; threadlocal_set_error (0); - limit = count < MAX_REQUEST_SIZE ? count : MAX_REQUEST_SIZE; - buf = calloc (limit, 1); - if (!buf) { - *err = ENOMEM; - return -1; - } + limit = count < sizeof (buf) ? count : sizeof (buf); while (count)...
2018 Mar 08
0
[nbdkit PATCH v3 11/15] plugins: Expose new FUA callbacks
...const void *buf, uint32_t count, uint64_t offset); int (*flush) (void *handle); int (*trim) (void *handle, uint32_t count, uint64_t offset); int (*zero) (void *handle, uint32_t count, uint64_t offset, int may_trim); +#else + int (*_pread_old) (void *, void *, uint32_t, uint64_t); + int (*_pwrite_old) (void *, const void *, uint32_t, uint64_t); + int (*_flush_old) (void *); + int (*_trim_old) (void *, uint32_t, uint64_t); + int (*_zero_old) (void *, uint32_t, uint64_t, int); +#endif int errno_is_preserved; void (*dump_plugin) (void); + int (*can_fua) (void *handle); +#if NBDKIT_API...
2019 Feb 08
0
[PATCH nbdkit] Add support for writing plugins in Rust.
...can_flush: Option<extern fn (*mut c_void) -> c_int>, + pub is_rotational: Option<extern fn (*mut c_void) -> c_int>, + pub can_trim: Option<extern fn (*mut c_void) -> c_int>, + + // Slots for old v1 API functions. + _pread_old: Option<extern fn ()>, + _pwrite_old: Option<extern fn ()>, + _flush_old: Option<extern fn ()>, + _trim_old: Option<extern fn ()>, + _zero_old: Option<extern fn ()>, + + errno_is_preserved: c_int, + + pub dump_plugin: Option<extern fn ()>, + + pub can_zero: Option<extern fn (*mut c_vo...
2019 Oct 04
6
[nbdkit PATCH 0/5] Another round of retry fixes
I still don't have .prepare/.finalize working cleanly across reopen, but did find a nasty bug where a botched assertion means we failed to notice reads beyond EOF in both the xz and retry filter. Refactoring backend.c will make .finalize work easier. Eric Blake (5): xz: Avoid reading beyond EOF retry: Check size before transactions tests: Test retry when get_size values change
2018 Mar 08
0
[nbdkit PATCH v3 15/15] RFC: plugins: Add back-compat for new plugin with old nbdkit
...\ + return (plugin).pread (handle, buf, count, offset, 0); \ + } \ + static int \ + nbdkit_pwrite_old (void *handle, const void *buf, uint32_t count, \ + uint64_t offset) \ + { \ + return (plugin).pwrite (handle, buf, count, offset, 0); \ + }...
2019 Feb 08
3
[PATCH nbdkit] Add support for writing plugins in Rust.
This adds very rough support for writing nbdkit plugins in Rust. This is not very idiomatic -- essentially we're handling the direct C calls from nbdkit in Rust. We have to use ‘unsafe’ in a few places because there's no way to tell the Rust code that nbdkit satisfies guarantees (eg. around thread safety, always returning leaked pointers back to the close function, always doing bounds
2019 Aug 23
1
[nbdkit PATCH 1/3] server: Add internal support for NBDKIT_FLAG_FAST_ZERO
...plugin.zero (connection_get_handle (conn, 0), count, offset, @@ -658,6 +673,12 @@ plugin_zero (struct backend *b, struct connection *conn, goto done; } + if (fast_zero) { + assert (r == -1); + *err = EOPNOTSUPP; + goto done; + } + assert (p->plugin.pwrite || p->plugin._pwrite_old); flags &= ~NBDKIT_FLAG_MAY_TRIM; threadlocal_set_error (0); @@ -762,6 +783,7 @@ static struct backend plugin_functions = { .is_rotational = plugin_is_rotational, .can_trim = plugin_can_trim, .can_zero = plugin_can_zero, + .can_fast_zero = plugin_can_fast_zero, .can_extents =...
2018 Mar 22
1
[nbdkit PATCH] plugins: Add .can_zero callback
...ection_get_handle (conn, 0), count, offset, + may_trim); + else + emulate = true; + if (r == -1) + *err = emulate ? EOPNOTSUPP : get_error (p); + if (r == 0 || *err != EOPNOTSUPP) + goto done; + } assert (p->plugin.pwrite || p->plugin._pwrite_old); flags &= ~NBDKIT_FLAG_MAY_TRIM; diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c index dd84b04..51de178 100644 --- a/plugins/nbd/nbd.c +++ b/plugins/nbd/nbd.c @@ -618,6 +618,14 @@ nbd_can_trim (void *handle) return h->flags & NBD_FLAG_SEND_TRIM; } +static int +nbd_can_zero (v...
2018 Mar 08
19
[nbdkit PATCH v3 00/15] Add FUA support to nbdkit
After more than a month since v2 [1], I've finally got my FUA support series polished. This is all of my outstanding patches, even though some of them were originally posted in separate threads from the original FUA post [2], [3] [1] https://www.redhat.com/archives/libguestfs/2018-January/msg00113.html [2] https://www.redhat.com/archives/libguestfs/2018-January/msg00219.html [3]
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