search for: nbd_flag_send_flush

Displaying 20 results from an estimated 34 matches for "nbd_flag_send_flush".

2017 Nov 15
1
[nbdkit PATCH] connections: Extract common export flag computation code
...+ if (fl == -1) + return -1; + if (readonly || !fl) { + eflags |= NBD_FLAG_READ_ONLY; + conn->readonly = 1; + } + if (!conn->readonly) { + eflags |= NBD_FLAG_SEND_WRITE_ZEROES; + } + + fl = plugin_can_flush (conn); + if (fl == -1) + return -1; + if (fl) { + eflags |= NBD_FLAG_SEND_FLUSH | NBD_FLAG_SEND_FUA; + conn->can_flush = 1; + } + + fl = plugin_is_rotational (conn); + if (fl == -1) + return -1; + if (fl) { + eflags |= NBD_FLAG_ROTATIONAL; + conn->is_rotational = 1; + } + + fl = plugin_can_trim (conn); + if (fl == -1) + return -1; + if (fl) { +...
2016 Sep 26
1
[PATCH] nbdkit: flags are 32 bits for oldstyle connections
...NBD_FLAG_HAS_FLAGS; fl = plugin_can_write (conn); if (fl == -1) return -1; if (readonly || !fl) { - eflags |= NBD_FLAG_READ_ONLY; + flags |= NBD_FLAG_READ_ONLY; conn->readonly = 1; } @@ -184,7 +183,7 @@ if (fl == -1) return -1; if (fl) { - eflags |= NBD_FLAG_SEND_FLUSH | NBD_FLAG_SEND_FUA; + flags |= NBD_FLAG_SEND_FLUSH | NBD_FLAG_SEND_FUA; conn->can_flush = 1; } @@ -192,7 +191,7 @@ if (fl == -1) return -1; if (fl) { - eflags |= NBD_FLAG_ROTATIONAL; + flags |= NBD_FLAG_ROTATIONAL; conn->is_rotational = 1; } @@ -200,7...
2020 Mar 17
0
[nbdkit PATCH 2/4] nbd: Normalize return values of can_*
...Copyright (C) 2017-2020 Red Hat Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1175,7 +1175,7 @@ nbd_can_flush (void *handle) { struct handle *h = handle; - return h->flags & NBD_FLAG_SEND_FLUSH; + return !!(h->flags & NBD_FLAG_SEND_FLUSH); } static int @@ -1183,7 +1183,7 @@ nbd_is_rotational (void *handle) { struct handle *h = handle; - return h->flags & NBD_FLAG_ROTATIONAL; + return !!(h->flags & NBD_FLAG_ROTATIONAL); } static int @@ -1191,7 +1191,7 @@...
2020 Mar 17
2
Re: [nbdkit PATCH 2/4] nbd: Normalize return values of can_*
...; * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions are > @@ -1175,7 +1175,7 @@ nbd_can_flush (void *handle) > { > struct handle *h = handle; > > - return h->flags & NBD_FLAG_SEND_FLUSH; > + return !!(h->flags & NBD_FLAG_SEND_FLUSH); > } > > static int > @@ -1183,7 +1183,7 @@ nbd_is_rotational (void *handle) > { > struct handle *h = handle; > > - return h->flags & NBD_FLAG_ROTATIONAL; > + return !!(h->flags & NBD_FLAG_R...
2018 Jan 24
0
[nbdkit PATCH 2/3] filter: Add .can_zero/.can_fua overrides
...= 1; } + + fl = backend->can_fua (backend, conn); + if (fl == -1) + return -1; + if (fl) { + eflags |= NBD_FLAG_SEND_FUA; + conn->can_fua = 1; + } } fl = backend->can_flush (backend, conn); if (fl == -1) return -1; if (fl) { - eflags |= NBD_FLAG_SEND_FLUSH | NBD_FLAG_SEND_FUA; + eflags |= NBD_FLAG_SEND_FLUSH; conn->can_flush = 1; } @@ -880,7 +896,7 @@ validate_request (struct connection *conn, *error = EINVAL; return false; } - if (!conn->can_flush && (flags & NBD_CMD_FLAG_FUA)) { + if (!conn->can_fua &...
2019 Jan 01
2
[PATCH nbdkit] server: Use bool for types which are really booleans.
...onnection *conn, uint16_t *flags) return -1; if (fl) { eflags |= NBD_FLAG_SEND_FUA; - conn->can_fua = 1; + conn->can_fua = true; } } @@ -452,7 +452,7 @@ compute_eflags (struct connection *conn, uint16_t *flags) return -1; if (fl) { eflags |= NBD_FLAG_SEND_FLUSH; - conn->can_flush = 1; + conn->can_flush = true; } fl = backend->is_rotational (backend, conn); @@ -460,7 +460,7 @@ compute_eflags (struct connection *conn, uint16_t *flags) return -1; if (fl) { eflags |= NBD_FLAG_ROTATIONAL; - conn->is_rotational = 1; +...
2017 Jan 20
7
[nbdkit PATCH 0/5] Add WRITE_ZEROES support
The upstream protocol recently promoted NBD_CMD_WRITE_ZEROES from experimental to a documented extension. Exposing support for this allows plugin writers to create sparse files when driven by a client that knows how to use the extension; meanwhile, even if a plugin does not support this extension, the server benefits from less network traffic from the client. Eric Blake (5): protocol: Support
2018 Dec 06
0
[PATCH nbdkit 3/5] protocol: Generate map functions from NBD protocol flags to printable strings.
...tern const char *name_of_nbd_global_flag (int); #define NBD_FLAG_FIXED_NEWSTYLE 1 #define NBD_FLAG_NO_ZEROES 2 /* Per-export flags. */ +extern const char *name_of_nbd_flag (int); #define NBD_FLAG_HAS_FLAGS (1 << 0) #define NBD_FLAG_READ_ONLY (1 << 1) #define NBD_FLAG_SEND_FLUSH (1 << 2) @@ -94,6 +96,7 @@ struct fixed_new_option_reply { #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) /* NBD options (new style handshake only). */ +extern const char *name_of_nbd_opt (int); #define NBD_OPT_EXPORT_NAME 1 #define NBD_OPT_ABORT 2 #define NBD_OPT_LIS...
2020 Mar 17
9
[nbdkit PATCH 0/4] Fix testsuite hang with nbd-stadalone
Either patch 1 or patch 2 in isolation is sufficient to fix the problem that Rich forwarded on from an archlinux tester (name so I can credit them?). But both patches should be applied, as well as backported to appropriate stable branches, to maximize cross-version interoperability of nbdkit vs. plugins. Patch 3 will let us detect future similar bugs much faster. I want patch 4 to ensure that
2019 Sep 24
0
[PATCH nbdkit 2/4] common/protocol: Remove protostrings.sed, use bash+sed instead.
...tern const char *name_of_nbd_global_flag (int); #define NBD_FLAG_FIXED_NEWSTYLE 1 #define NBD_FLAG_NO_ZEROES 2 /* Per-export flags. */ -extern const char *name_of_nbd_flag (int); #define NBD_FLAG_HAS_FLAGS (1 << 0) #define NBD_FLAG_READ_ONLY (1 << 1) #define NBD_FLAG_SEND_FLUSH (1 << 2) @@ -99,7 +97,6 @@ extern const char *name_of_nbd_flag (int); #define NBD_FLAG_SEND_FAST_ZERO (1 << 11) /* NBD options (new style handshake only). */ -extern const char *name_of_nbd_opt (int); #define NBD_OPT_EXPORT_NAME 1 #define NBD_OPT_ABORT...
2018 Jan 24
8
[nbdkit PATCH 0/3] Add nozero filter
I still need to add testsuite coverage. Perhaps it might be easier if I create a new '--filter=log logfile=foo' filter that produces a log of which commands a client sent, then compare the log using a known client that uses write_zeroes (qemu-io works well) both with and without --filter=nozero to prove that the change in advertisement changes the commands sent over the wire (that would
2016 Jan 11
1
[PATCH] Add support for newstyle NBD protocol (RHBZ#1297100).
Experimental and only very lightly tested so far. Rich.
2018 Jan 16
9
[nbdkit PATCH 0/7] Initial implementation of FUA flag passthrough
Tested via: term1$ qemu-nbd -k $PWD/sock -t -f raw -x foo junk --trace=nbd_\* term2$ ./nbdkit -f -v -e bar nbd socket=$PWD/sock export=foo term3$ qemu-io -t none -f raw nbd://localhost:10809/bar --trace=nbd_\* and checking the traces to see that 'w 0 1' vs. 'w -f 0 1' was able to influence whether the FUA flag showed up at the server in term1. Still to go: figure out how to
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
...write) + eflags |= NBD_FLAG_SEND_TRIM; + + fl = backend_can_fua (backend, conn); + if (fl == -1) + return -1; + if (fl && can_write) + eflags |= NBD_FLAG_SEND_FUA; fl = backend_can_flush (backend, conn); if (fl == -1) return -1; - if (fl) { + if (fl) eflags |= NBD_FLAG_SEND_FLUSH; - conn->can_flush = true; - } fl = backend_is_rotational (backend, conn); if (fl == -1) return -1; - if (fl) { + if (fl) eflags |= NBD_FLAG_ROTATIONAL; - conn->is_rotational = true; - } - /* multi-conn is useless if parallel connections are not allowed */ - if (...
2018 Dec 06
10
[PATCH nbdkit 0/5] protocol: Generate map functions from NBD protocol flags to printable strings.
With some crufty sed scripts we can generate functions that map from NBD protocol flags (eg. NBD_CMD_READ) to strings ("NBD_CMD_READ"). This works on GNU sed and with FreeBSD, also with GNU sed's --posix option, so I guess the sed code is POSIX-compatible. Rich.
2017 Nov 14
0
[nbdkit PATCH v2 1/2] nbd: Add new nbd forwarding plugin
...+{ + struct handle *h = handle; + + return h->size; +} + +static int +nbd_can_write (void *handle) +{ + struct handle *h = handle; + + return !(h->flags & NBD_FLAG_READ_ONLY); +} + +static int +nbd_can_flush (void *handle) +{ + struct handle *h = handle; + + return h->flags & NBD_FLAG_SEND_FLUSH; +} + +static int +nbd_is_rotational (void *handle) +{ + struct handle *h = handle; + + return h->flags & NBD_FLAG_ROTATIONAL; +} + +static int +nbd_can_trim (void *handle) +{ + struct handle *h = handle; + + return h->flags & NBD_FLAG_SEND_TRIM; +} + +/* Read data from the file....
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...; - } - - fl = backend->can_fua (backend, conn); - if (fl == -1) - return -1; - if (fl) { - eflags |= NBD_FLAG_SEND_FUA; - conn->can_fua = true; - } - } - - fl = backend->can_flush (backend, conn); - if (fl == -1) - return -1; - if (fl) { - eflags |= NBD_FLAG_SEND_FLUSH; - conn->can_flush = true; - } - - fl = backend->is_rotational (backend, conn); - if (fl == -1) - return -1; - if (fl) { - eflags |= NBD_FLAG_ROTATIONAL; - conn->is_rotational = true; - } - - fl = backend->can_multi_conn (backend, conn); - if (fl == -1) - return -1...
2017 Nov 12
6
[nbdkit PATCH] nbd: Add new nbd forwarding plugin
...) +{ + struct handle *h = handle; + + return h->size; +} + +static int nbd_can_write (void *handle) +{ + struct handle *h = handle; + + return !(h->flags & NBD_FLAG_READ_ONLY); +} + +static int nbd_can_flush (void *handle) +{ + struct handle *h = handle; + + return h->flags & NBD_FLAG_SEND_FLUSH; +} + +static int nbd_is_rotational (void *handle) +{ + struct handle *h = handle; + + return h->flags & NBD_FLAG_ROTATIONAL; +} + +static int nbd_can_trim (void *handle) +{ + struct handle *h = handle; + + return h->flags & NBD_FLAG_SEND_TRIM; +} + +static int nbd_request (struct...
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status implementation. While the patches (especially the second one) are very large they are really just elementary code motion. Rich.
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...== -1) { + nbdkit_error ("failure to check readonly flag: %s", nbd_get_error ()); + return -1; + } + return !(i || h->readonly); } static int nbdplug_can_flush (void *handle) { struct handle *h = handle; + int i = nbd_can_flush (h->nbd); - return h->flags & NBD_FLAG_SEND_FLUSH; + if (i == -1) { + nbdkit_error ("failure to check flush flag: %s", nbd_get_error ()); + return -1; + } + return i; } static int nbdplug_is_rotational (void *handle) { struct handle *h = handle; + int i = nbd_is_rotational (h->nbd); - return h->flags & NBD_F...