search for: nbd_flag_rot

Displaying 20 results from an estimated 31 matches for "nbd_flag_rot".

2017 Nov 15
1
[nbdkit PATCH] connections: Extract common export flag computation code
...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) { + eflags |= NBD_FLAG_SEND_TRIM; + conn->can_trim = 1; + } + + *flags = eflags; + return 0; +} + +static int _negotiate_handshake_oldstyle (struct connection *co...
2016 Sep 26
1
[PATCH] nbdkit: flags are 32 bits for oldstyle connections
...} @@ -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 +199,7 @@ if (fl == -1) return -1; if (fl) { - eflags |= NBD_FLAG_SEND_TRIM; + flags |= NBD_FLAG_SEND_TRIM; conn->can_trim = 1; } @@ -208,19 +207,17 @@ if (fl == -1) re...
2020 Mar 17
0
[nbdkit PATCH 2/4] nbd: Normalize return values of can_*
...@ 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 @@ nbd_can_trim (void *handle) { struct handle *h = handle; - return h->flags & NBD_FLAG_SEND_TRIM; + return !!(h->flags & NBD_FLAG_SEND_TRIM); } static int @@ -1199,7 +1199,7 @@...
2020 Mar 17
2
Re: [nbdkit PATCH 2/4] nbd: Normalize return values of can_*
...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 @@ nbd_can_trim (void *handle) > { > struct handle *h = handle; > > - return h->flags & NBD_FLAG_SEND_TRIM; > + return !!(h->flags & NBD_FLAG_...
2019 Mar 29
3
[nbdkit PATCH] protocol: Trivially implement NBD_CMD_FLAG_DF
...irst +place. + =item Resize Extension I<Not supported>. diff --git a/common/protocol/protocol.h b/common/protocol/protocol.h index a7de2f0..4334be4 100644 --- a/common/protocol/protocol.h +++ b/common/protocol/protocol.h @@ -94,6 +94,7 @@ extern const char *name_of_nbd_flag (int); #define NBD_FLAG_ROTATIONAL (1 << 4) #define NBD_FLAG_SEND_TRIM (1 << 5) #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) +#define NBD_FLAG_SEND_DF (1 << 7) #define NBD_FLAG_CAN_MULTI_CONN (1 << 8) /* NBD options (new style handshake only). */ @@ -217,6 +218,7 @...
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
2016 Jan 11
1
[PATCH] Add support for newstyle NBD protocol (RHBZ#1297100).
Experimental and only very lightly tested so far. Rich.
2019 Mar 29
0
Re: [nbdkit PATCH] protocol: Trivially implement NBD_CMD_FLAG_DF
...gt; > I<Not supported>. > diff --git a/common/protocol/protocol.h b/common/protocol/protocol.h > index a7de2f0..4334be4 100644 > --- a/common/protocol/protocol.h > +++ b/common/protocol/protocol.h > @@ -94,6 +94,7 @@ extern const char *name_of_nbd_flag (int); > #define NBD_FLAG_ROTATIONAL (1 << 4) > #define NBD_FLAG_SEND_TRIM (1 << 5) > #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) > +#define NBD_FLAG_SEND_DF (1 << 7) > #define NBD_FLAG_CAN_MULTI_CONN (1 << 8) > > /* NBD options (new style handshak...
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 Apr 01
3
Re: [nbdkit PATCH] protocol: Trivially implement NBD_CMD_FLAG_DF
...orted>. >> diff --git a/common/protocol/protocol.h b/common/protocol/protocol.h >> index a7de2f0..4334be4 100644 >> --- a/common/protocol/protocol.h >> +++ b/common/protocol/protocol.h >> @@ -94,6 +94,7 @@ extern const char *name_of_nbd_flag (int); >> #define NBD_FLAG_ROTATIONAL (1 << 4) >> #define NBD_FLAG_SEND_TRIM (1 << 5) >> #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) >> +#define NBD_FLAG_SEND_DF (1 << 7) >> #define NBD_FLAG_CAN_MULTI_CONN (1 << 8) >> >> /* NBD opti...
2019 Jan 04
0
[PATCH nbdkit 1/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
...ction *conn, void *buf, uint32_t count, uint64_t offset, uint32_t flags, int *err); diff --git a/server/protocol.h b/server/protocol.h index 6709ddc..003fc45 100644 --- a/server/protocol.h +++ b/server/protocol.h @@ -94,6 +94,7 @@ extern const char *name_of_nbd_flag (int); #define NBD_FLAG_ROTATIONAL (1 << 4) #define NBD_FLAG_SEND_TRIM (1 << 5) #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) +#define NBD_FLAG_CAN_MULTI_CONN (1 << 8) /* NBD options (new style handshake only). */ extern const char *name_of_nbd_opt (int); diff --git a/server/conne...
2019 Jan 01
2
[PATCH nbdkit] server: Use bool for types which are really booleans.
...eturn -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; + conn->is_rotational = true; } *flags = eflags; @@ -793,7 +793,7 @@ _negotiate_handshake_newstyle_options (struct connection *conn) /* Upgrade the connection to TLS. Also performs access control. */ if (crypto_negotiate_tls...
2019 Aug 30
0
[nbdkit PATCH 6/9] server: Cache per-connection can_FOO flags
..._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 (backend->thread_model (backend) > - NBDKIT_THREAD_MODEL_SERIALIZE_CONNECTIONS) { - fl = backend_can_multi_conn (backend, conn); - if (fl == -1) - ret...
2017 Nov 14
0
[nbdkit PATCH v2 1/2] nbd: Add new nbd forwarding plugin
...; + + 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. */ +static int +nbd_pread (void *handle, void *buf, uint32_t count, uint64_t offset) +{ + struct handle *h = handle; + int c;...
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...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; - if (fl) { - eflags |= NBD_FLAG_CAN_MULTI_CONN; - conn->can_multi_conn = true; - } - - *flags = eflags; - return 0; -} - -static int -_negotiate_hand...
2017 Nov 12
6
[nbdkit PATCH] nbd: Add new nbd forwarding plugin
...le; + + 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 handle *h, uint32_t type, uint64_t offset, + uint32_t count, uint64_t *cookie) +{ + struct request req = { + .magic = ht...
2019 Jan 04
10
[PATCH nbdkit 0/7] server: Implement NBD_FLAG_CAN_MULTI_CONN.
First thing to say is that I need to do a *lot* more testing on this, so this is just an early peek. In particular, although it passed ‘make check && make check-valgrind’ I have *not* tested it against a multi-conn-aware client such as the Linux kernel >= 4.9. This implements NBD_FLAG_CAN_MULTI_CONN, described in the protocol doc as: "NBD_FLAG_CAN_MULTI_CONN: Indicates that
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 Jan 05
15
[PATCH nbdkit v2 01/11] server: Implement NBD_FLAG_CAN_MULTI_CONN.
For existing commits, this is almost identical to v1, except that I updated some commit messages and reordered the commits in a somewhat more logical sequence. The main changes are the extra commits: [06/11] plugins: Return NBD_FLAG_CAN_MULTI_CONN from some readonly plugins. - Readonly plugins that can set the flag unconditionally. [09/11] partitioning: Return NBD_FLAG_CAN_MULTI_CONN. [10/11]
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...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_FLAG_ROTATIONAL; + if (i == -1) { + nbdkit_error ("failure to check rotational flag: %s", nbd_get_error ()); + return -1; + } + return i; } static int nbdplug_can_trim (void *handle) { struct handle *h = handle; + int i = nbd_can_trim (h->nbd); - return h->flags & NBD...