search for: aio_pwrite

Displaying 20 results from an estimated 35 matches for "aio_pwrite".

2019 Jun 29
1
Re: [libnbd PATCH 5/6] api: Add new nbd_aio_FOO_notify functions
...args, List.tl args in assert (flags = Flags "flags"); let args = flags :: CallbackPersist ("notify", [ etc ]) :: args in let args = List.rev args in let longdesc = longdesc ^ "\nThe C<notify> callback blah blah ..." in { call with args; longdesc } let aio_pwrite_call = { default_call with args = [ BytesPersistIn ("buf", "count"); UInt64 "offset"; Flags "flags" ]; ] (* etc copy the definition of aio_pwrite *) } let aio_pwrite_notify_call = make_notify_variant_of_call aio_pwrite_call let handle_calls = [ ......
2019 May 21
0
[libnbd] tmp patch adding deadlock test
...before aio_pread\n"); + handles[0] = nbd_aio_pread (conn, in, packetsize, 0); + if (handles[0] == -1) { + fprintf (stderr, "%s\n", nbd_get_error ()); + goto error; + } + fprintf (stderr, " * after aio_pread\n"); + in_flight++; + fprintf (stderr, " * before aio_pwrite\n"); + handles[1] = nbd_aio_pwrite (conn, out, packetsize, packetsize, 0); + if (handles[1] == -1) { + fprintf (stderr, "%s\n", nbd_get_error ()); + goto error; + } + fprintf (stderr, " * after aio_pwrite\n"); + in_flight++; + + /* Now wait for commands to retir...
2019 Aug 13
2
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
This applies on top of the OClosure v2 series posted a few minutes ago. Rich.
2019 Aug 13
0
[PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...mmands. */ - cookies[0] = nbd_aio_pread (nbd, in, packetsize, 0, 0); + cookies[0] = nbd_aio_pread (nbd, in, packetsize, 0, + NULL, NULL, 0); if (cookies[0] == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); goto error; } - cookies[1] = nbd_aio_pwrite (nbd, out, packetsize, packetsize, 0); + cookies[1] = nbd_aio_pwrite (nbd, out, packetsize, packetsize, NULL, NULL, 0); if (cookies[1] == -1) { fprintf (stderr, "%s\n", nbd_get_error ()); goto error; diff --git a/examples/glib-main-loop.c b/examples/glib-main-loop.c index 05...
2019 Aug 10
0
[PATCH libnbd 1/5] python: Change aio_buffer into nbd.Buffer class.
...ap fst handle_calls); pr " { NULL, NULL, 0, NULL }\n"; pr "};\n"; pr "\n"; @@ -4502,17 +4506,28 @@ Error.__str__ = _str pr "\ -# AIO buffer functions. -def aio_buffer (len): - '''allocate an AIO buffer used for nbd.aio_pread and nbd.aio_pwrite''' - return libnbdmod.alloc_aio_buffer (len) - -def aio_buffer_from_bytearray (ba): - '''create an AIO buffer from a bytearray''' - return libnbdmod.aio_buffer_from_bytearray (ba) -def aio_buffer_to_bytearray (buf): - '''copy an AIO buffer...
2019 Aug 10
0
[PATCH libnbd 2/9] generator: Generalize OFlags.
...- generator/generator | 180 +++++++++++++++++------ ocaml/nbd-c.h | 15 -- ocaml/tests/test_405_pread_structured.ml | 6 +- ocaml/tests/test_410_pwrite.ml | 3 +- ocaml/tests/test_460_block_status.ml | 3 +- ocaml/tests/test_510_aio_pwrite.ml | 3 +- 6 files changed, 142 insertions(+), 68 deletions(-) diff --git a/generator/generator b/generator/generator index 78c6ca6..5823686 100755 --- a/generator/generator +++ b/generator/generator @@ -865,7 +865,7 @@ and arg = | UInt32 of string (* 32 bit unsigned int *) | UIn...
2019 Aug 10
7
[PATCH libnbd 0/5] WIP: python: Add test for doing asynch copy.
This doesn't yet work. However it does make me more convinced than ever that we really need to sort out persistent buffer lifetimes in the library (similar to what we did for closures). Rich.
2019 May 21
9
[libnbd PATCH 0/3] Avoid deadlock with in-flight commands
...nal solution, but it certainly seems to solve a deadlock for me that I could trigger by using 'nbdkit --filter=noparallel memory 512k' and calling nbd_aio_pread for a request larger than 256k (enough for the Linux kernel to block the server until libnbd read()s), immediately followed by nbd_aio_pwrite for a request larger than 256k (enough to block libnbd until the server read()s, but the serialized server won't read until we parse off the reply). My solution was to allow a notifyread at any time we are in the middle of writing a request, at which point we pause the current write, force the...
2020 Jul 24
4
[libnbd PATCH 0/3] Expose server block size constraints
Necessary when writing a client that wants to avoid unnecessary EINVAL errors from sending unaligned requests. At some point, we may want to add synchronous convenience API wrappers that do request splitting or read-modify-write to obey server constraints while still appearing to the library client as accepting any possible request. But such a wrapper should only be synchronous and not copied to
2019 Aug 14
0
[PATCH libnbd 3/3] python: Add test for doing asynch copy from one handle to another.
...read_completed (buf, soff, err)) + soff += bufsize + + # If there are any write commands waiting to be issued + # to the destination, send them now. + for buf, offset in writes: + # See above link about broken Python lambdas. + dst.aio_pwrite (buf, offset, + lambda err, buf=buf: + write_completed (buf, err)) + writes = [] + + poll = select.poll () + + sfd = src.aio_get_fd () + dfd = dst.aio_get_fd () + + sevents = 0 + devents = 0 + if...
2019 Sep 05
0
[PATCH libnbd] generator: Move first_version fields to a single table.
...;, (1, 0); + "aio_connect", (1, 0); + "aio_connect_uri", (1, 0); + "aio_connect_unix", (1, 0); + "aio_connect_tcp", (1, 0); + "aio_connect_command", (1, 0); + "aio_pread", (1, 0); + "aio_pread_structured", (1, 0); + "aio_pwrite", (1, 0); + "aio_disconnect", (1, 0); + "aio_flush", (1, 0); + "aio_trim", (1, 0); + "aio_cache", (1, 0); + "aio_zero", (1, 0); + "aio_block_status", (1, 0); + "aio_get_fd", (1, 0); + "aio_get_direction", (...
2011 Sep 02
5
Linux kernel crash due to ocfs2
...balloc_bits+0xadc/0xd94 [ocfs2] .__ocfs2_claim_clusters+0x1b0/0x348 [ocfs2] .ocf2_do_extend_allocation+0x1f8/0x5b4 [ocfs2] .ocfs2_write_cluster_by_desc+0x128/0x850 [ocfs2] .ocfs2_write_begin_nolock+0xdc0/0xfbc [ocfs2] .ocfs2_write_begin+0x124/0x224 [ocfs2] .ocfs2_file_aio_write+0x6a4/0xb40 [ocfs2] .aio_pwrite+0x50/0xb4 .aio_run_iocb+0x140/0x214 .io_submit_one+0x2fc/0x3a8 .sys_io_submit+0xd0/0x17c syscall_exit+0x0/0x40 In the last crash case, the file system was full. Any clues? There seems to be a ocfs2 kernel patch some time ago for the 2.6.20.2 kernel that fixed some journal credits updates. Is th...
2019 Sep 05
3
[PATCH libnbd] generator: Move first_version fields to a single table.
This doesn't include Eric's new APIs, but if you push those then I can rebase this one on top. Rich.
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...data has been committed to permanent storage (if that is supported - some servers cannot do this, see -L<nbd_can_fua(3)>)."; +L<nbd_can_fua(3)>)." +^ strict_call_description; see_also = [Link "can_fua"; Link "is_read_only"; - Link "aio_pwrite"; Link "get_block_size"]; + Link "aio_pwrite"; Link "get_block_size"; + Link "set_strict_mode"]; example = Some "examples/reads-and-writes.c"; }; @@ -1657,11 +1725,13 @@ A future version of the library may...
2019 Aug 13
1
Re: [PATCH libnbd] api: Rename nbd_aio_*_callback to nbd_aio_*.
...t ~completion starts just after the ( above) > soff := !soff +^ bs > ); > @@ -59,7 +59,7 @@ let asynch_copy src dst = > List.iter ( > fun (buf, offset) -> > (* Note the size of the write is implicitly stored in buf. *) > - ignore (NBD.aio_pwrite_callback dst buf offset > + ignore (NBD.aio_pwrite dst buf offset > ~completion:(write_completed buf)) and here > +++ b/ocaml/tests/test_590_aio_copy.ml > @@ -71,7 +71,7 @@ let asynch_copy src dst = > if !soff < size && NBD.aio_in_flight s...
2019 Jun 21
0
[libnbd PATCH v2 3/5] states: Add nbd_pread_structured API
...ue a read command to the NBD server. This returns the +unique positive 64 bit handle for this command, or C<-1> on +error. To check if the command completed, call +C<nbd_aio_command_completed>. Parameters behave as documented +in C<nbd_pread_structured>."; + }; + "aio_pwrite", { default_call with args = [ BytesPersistIn ("buf", "count"); UInt64 "offset"; Flags "flags" ]; diff --git a/lib/rw.c b/lib/rw.c index dc81c57..24dbc4e 100644 --- a/lib/rw.c +++ b/lib/rw.c @@ -55,6 +55,22 @@ nbd_unlocked_pread (struct nbd_han...
2020 Sep 11
0
[libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...see_also = [SectionLink "Issuing asynchronous commands"; - Link "aio_pread"; Link "pread_structured"]; + Link "aio_pread"; Link "pread_structured"; + Link "set_strict_mode"]; }; "aio_pwrite", { diff --git a/generator/API.mli b/generator/API.mli index db978ca..41e09f5 100644 --- a/generator/API.mli +++ b/generator/API.mli @@ -100,6 +100,7 @@ and enum = { } and flags = { flag_prefix : string; (** prefix of each flag name *) + guard : string option; (** additional gating...
2019 Jun 18
0
[libnbd PATCH 6/8] states: Add nbd_pread_callback API
...ssue a read command to the NBD server. This returns the +unique positive 64 bit handle for this command, or C<-1> on +error. To check if the command completed, call +C<nbd_aio_command_completed>. Parameters behave as documented +in C<nbd_pread_callback>."; + }; + "aio_pwrite", { default_call with args = [ BytesPersistIn ("buf", "count"); UInt64 "offset"; Flags "flags" ]; @@ -3264,7 +3349,8 @@ let print_python_binding name { args; ret } = pr " PyObject *py_%s = PyList_New (%s);\n" n len;...
2019 May 22
10
[libnbd PATCH v2 0/5] Avoid deadlock with in-flight commands
On v1, we discussed whether cmds_to_issue needed to be a list, since it never had more than one element. I played with the idea of making it a list, and allowing the client to queue up new commands regardless of whether the state machine is currently in READY. I also polished up the tmp demo into a bit more full-fledged example file, worth including since it also let me discover a hard-to-hit race
2019 May 28
0
[PATCH] api: Add a special type for the flags argument.
...t64 "offset"; - UInt32 "flags" ]; + Flags "flags" ]; ret = RInt64; shortdesc = "read from the NBD server"; longdesc = "\ @@ -1497,7 +1498,7 @@ parameters behave as documented in C<nbd_pread>."; "aio_pwrite", { default_call with - args = [ BytesPersistIn ("buf", "count"); UInt64 "offset"; UInt32 "flags" ]; + args = [ BytesPersistIn ("buf", "count"); UInt64 "offset"; Flags "flags" ]; ret = RInt64;...