search for: read_chunk

Displaying 20 results from an estimated 27 matches for "read_chunk".

2019 Jul 24
2
Re: [PATCH libnbd 2/3] lib: Implement closure lifetimes.
...f (!(valid_flag & LIBNBD_CALLBACK_VALID)) return 0; > + > + // Rest of callback as normal. > + } Both examples are good. > +++ b/examples/strict-structured-reads.c > @@ -51,12 +51,16 @@ static int64_t total_bytes; > static int total_success; > > static int > -read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, > +read_chunk (int valid_flag, void *opaque, > + const void *bufv, size_t count, uint64_t offset, > int status, int *error) > { > struct data *data = opaque; > struct range *r, **prev; &...
2019 Jun 29
0
[libnbd PATCH 6/6] examples: New example for strict read validations
...+ +/* Various statistics */ +static int total_data_chunks; +static int total_data_bytes; +static int total_hole_chunks; +static int total_hole_bytes; +static int total_chunks; +static int total_df_reads; +static int total_reads; +static int64_t total_bytes; +static int total_success; + +static int +read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, + int *error, int status) +{ + struct data *data = opaque; + struct range *r, **prev; + + /* libnbd guarantees this: */ + assert (offset >= data->offset); + assert (offset + count <= data->offset + data->...
2019 Aug 12
0
[PATCH libnbd 7/7] api: Remove the valid_flag from all callbacks.
...return 0; diff --git a/examples/strict-structured-reads.c b/examples/strict-structured-reads.c index b3880b7..701b216 100644 --- a/examples/strict-structured-reads.c +++ b/examples/strict-structured-reads.c @@ -51,16 +51,13 @@ static int64_t total_bytes; static int total_success; static int -read_chunk (unsigned valid_flag, void *opaque, +read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, unsigned status, int *error) { struct data *data = opaque; struct range *r, **prev; - if (!(valid_flag & LIBNBD_CALLBACK_VALID)) - return 0; -...
2019 Jul 24
2
Re: [PATCH libnbd 2/3] lib: Implement closure lifetimes.
...callback with > valid_flag == LIBNBD_CALLBACK_VALID|LIBNBD_CALLBACK_FREE, meaning it's the > last valid call.) [1] In my previous reply, I assumed that the nbd_aio_FOO_callback function would use this paradigm... > +++ b/examples/strict-structured-reads.c > @@ -127,11 +131,14 @@ read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, > } > > static int > -read_verify (void *opaque, int64_t cookie, int *error) > +read_verify (int valid_flag, void *opaque, int64_t cookie, int *error) > { > struct data *data = opaque; > int ret = -1;...
2019 Aug 13
0
[PATCH libnbd 2/4] api: Add free function and remove valid_flag parameter.
...return 0; diff --git a/examples/strict-structured-reads.c b/examples/strict-structured-reads.c index d7c3e1b..6ea1700 100644 --- a/examples/strict-structured-reads.c +++ b/examples/strict-structured-reads.c @@ -51,16 +51,13 @@ static int64_t total_bytes; static int total_success; static int -read_chunk (unsigned valid_flag, void *opaque, +read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, unsigned status, int *error) { struct data *data = opaque; struct range *r, **prev; - if (!(valid_flag & LIBNBD_CALLBACK_VALID)) - return 0; -...
2019 Jul 24
0
Re: [PATCH libnbd 2/3] lib: Implement closure lifetimes.
...ACK_VALID|LIBNBD_CALLBACK_FREE, meaning it's the > > last valid call.) > > [1] In my previous reply, I assumed that the nbd_aio_FOO_callback > function would use this paradigm... > > > > +++ b/examples/strict-structured-reads.c > > > @@ -127,11 +131,14 @@ read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, > > } > > > > static int > > -read_verify (void *opaque, int64_t cookie, int *error) > > +read_verify (int valid_flag, void *opaque, int64_t cookie, int *error) > > { > > struct data *d...
2012 Jan 27
2
dealing with Encoding::UndefinedConversionError: "\xA2" from ASCII-8BIT to UTF-8
...k in response_read'' from /usr/local/lib/ruby/1.9.1/net/protocol.rb:387:in `call_block'' from /usr/local/lib/ruby/1.9.1/net/protocol.rb:378:in `<<'' from /usr/local/lib/ruby/1.9.1/net/protocol.rb:88:in `read'' from /usr/local/lib/ruby/1.9.1/net/http.rb:2445:in `read_chunked'' from /usr/local/lib/ruby/1.9.1/net/http.rb:2419:in `read_body_0'' from /usr/local/lib/ruby/1.9.1/net/http.rb:2379:in `read_body'' from /app/vendor/bundle/ruby/1.9.1/gems/mechanize-2.1/lib/mechanize/http/agent.rb:795:in `response_read'' from /app/vendor/bundle/rub...
2019 Jul 16
1
[libnbd PATCH] generator: Prefer closure opaque after function pointer in C
...range) { .first = offset, .last = offset + maxsize, }; *d = (struct data) { .offset = offset, .count = maxsize, .flags = flags, .remaining = r, }; - if (nbd_aio_pread_structured_callback (nbd, buf, sizeof buf, offset, d, - read_chunk, read_verify, + if (nbd_aio_pread_structured_callback (nbd, buf, sizeof buf, offset, + read_chunk, read_verify, d, flags) == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); exit (EXIT_...
2019 Jul 24
6
[PATCH libnbd 0/3] Implement closure lifetimes.
This implements most of what I wrote here: https://www.redhat.com/archives/libguestfs/2019-July/msg00213.html
2006 Dec 07
6
Response To Form Submission Hanging
...39;' from /usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout'' from /usr/local/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'' from /usr/local/lib/ruby/1.8/net/protocol.rb:86:in `read'' from /usr/local/lib/ruby/1.8/net/http.rb:2200:in `read_chunked'' from /usr/local/lib/ruby/1.8/net/http.rb:2175:in `read_body_0'' from /usr/local/lib/ruby/1.8/net/http.rb:2141:in `read_body'' ... 7 levels... from /usr/local/lib/ruby/gems/1.8/gems/mechanize-0.6.3/lib/ mechanize.rb:265:in `post_form&...
2019 Jul 24
0
Re: [PATCH libnbd 2/3] lib: Implement closure lifetimes.
...other flags would be useful here, but as long as we've told correct callers that they must ignore flags that they don't know about it may be possible to add new features here in future without breaking ABI. > > +++ b/examples/strict-structured-reads.c > > @@ -127,11 +131,14 @@ read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, > > } > > > > static int > > -read_verify (void *opaque, int64_t cookie, int *error) > > +read_verify (int valid_flag, void *opaque, int64_t cookie, int *error) > > { > > struct data *d...
2019 Jul 24
0
[PATCH libnbd 2/3] lib: Implement closure lifetimes.
...return 0; diff --git a/examples/strict-structured-reads.c b/examples/strict-structured-reads.c index a50f662..c154b08 100644 --- a/examples/strict-structured-reads.c +++ b/examples/strict-structured-reads.c @@ -51,12 +51,16 @@ static int64_t total_bytes; static int total_success; static int -read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, +read_chunk (int valid_flag, void *opaque, + const void *bufv, size_t count, uint64_t offset, int status, int *error) { struct data *data = opaque; struct range *r, **prev; + if (!(valid_flag & LIB...
2019 Jul 24
0
[PATCH libnbd v2 2/5] lib: Implement closure lifetimes.
...return 0; diff --git a/examples/strict-structured-reads.c b/examples/strict-structured-reads.c index a50f662..a996a67 100644 --- a/examples/strict-structured-reads.c +++ b/examples/strict-structured-reads.c @@ -51,12 +51,16 @@ static int64_t total_bytes; static int total_success; static int -read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, +read_chunk (unsigned valid_flag, void *opaque, + const void *bufv, size_t count, uint64_t offset, int status, int *error) { struct data *data = opaque; struct range *r, **prev; + if (!(valid_flag &amp...
2019 Jul 24
0
[PATCH libnbd v2 5/5] lib: Use unsigned for pread_structured status parameter.
...s changed, 39 insertions(+), 36 deletions(-) diff --git a/examples/strict-structured-reads.c b/examples/strict-structured-reads.c index a996a67..2279301 100644 --- a/examples/strict-structured-reads.c +++ b/examples/strict-structured-reads.c @@ -53,7 +53,7 @@ static int total_success; static int read_chunk (unsigned valid_flag, void *opaque, const void *bufv, size_t count, uint64_t offset, - int status, int *error) + unsigned status, int *error) { struct data *data = opaque; struct range *r, **prev; diff --git a/generator/generator b/generator/generator index...
2019 Aug 13
8
[PATCH libnbd 0/4] Add free function to callbacks.
Patches 1 & 2 are rather complex, but the end result is that we pass closures + user_data + free function in single struct parameters as I described previously in this email: https://www.redhat.com/archives/libguestfs/2019-August/msg00210.html Patch 3 adds a convenient FREE_CALLBACK macro which seems a worthwhile simplification if you buy into 1 & 2. Patch 4 adds another macro which is
2019 Jul 25
0
[PATCH libnbd v3 1/2] lib: Implement closure lifetimes.
...return 0; diff --git a/examples/strict-structured-reads.c b/examples/strict-structured-reads.c index 1a551a0..511dd7c 100644 --- a/examples/strict-structured-reads.c +++ b/examples/strict-structured-reads.c @@ -51,12 +51,16 @@ static int64_t total_bytes; static int total_success; static int -read_chunk (void *opaque, const void *bufv, size_t count, uint64_t offset, +read_chunk (unsigned valid_flag, void *opaque, + const void *bufv, size_t count, uint64_t offset, unsigned status, int *error) { struct data *data = opaque; struct range *r, **prev; + if (!(valid_flag...
2019 Aug 14
1
Re: [PATCH libnbd 2/4] api: Add free function and remove valid_flag parameter.
...e function... > > return ret; > } > @@ -237,7 +228,7 @@ main (int argc, char *argv[]) > .remaining = r, }; > if (nbd_aio_pread_structured (nbd, buf, sizeof buf, offset, > (nbd_chunk_callback) { .callback = read_chunk, .user_data = d }, > - (nbd_completion_callback) { .callback = read_verify, .user_data = d }, > + (nbd_completion_callback) { .callback = read_verify, .user_data = d, .free = free ...rather than using free(). But it works as...
2019 Jul 24
8
[PATCH libnbd v2 0/5] lib: Implement closure lifetimes.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-July/thread.html#00231 The changes address everything that Eric picked up in his review of the first two patches. I have also added two more patches (4 and 5) which respectively fix docs and change int status -> unsigned status, as discussed. Passes make, check, check-valgrind. Rich.
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...uct range) { .first = offset, .last = offset + maxsize, }; *d = (struct data) { .offset = offset, .count = maxsize, .flags = flags, .remaining = r, }; - if (nbd_aio_pread_structured_callback (nbd, buf, sizeof buf, offset, - read_chunk, d, read_verify, d, - flags) == -1) { + if (nbd_aio_pread_structured (nbd, buf, sizeof buf, offset, + read_chunk, d, read_verify, d, + flags) == -1) { fprintf (stderr, "%s\n&qu...
2019 Aug 12
14
[PATCH libnbd 0/7] Add free callbacks and remove valid_flag.
As proposed here: https://www.redhat.com/archives/libguestfs/2019-August/msg00130.html I didn't actually read Eric's replies to that yet because I've been concentrating on writing these patches all day. Anyway here they are and I'll look at what Eric said about the proposal next. Rich.