1nbd_aio_block_status(3) LIBNBD nbd_aio_block_status(3)
2
3
4
6 nbd_aio_block_status - send block status command to the NBD server
7
9 #include <libnbd.h>
10
11 typedef struct {
12 int (*callback) (void *user_data,
13 const char *metacontext,
14 uint64_t offset, uint32_t *entries,
15 size_t nr_entries, int *error);
16 void *user_data;
17 void (*free) (void *user_data);
18 } nbd_extent_callback;
19
20 typedef struct {
21 int (*callback) (void *user_data, int *error);
22 void *user_data;
23 void (*free) (void *user_data);
24 } nbd_completion_callback;
25
26 int64_t nbd_aio_block_status (
27 struct nbd_handle *h, uint64_t count,
28 uint64_t offset,
29 nbd_extent_callback extent_callback,
30 nbd_completion_callback completion_callback,
31 uint32_t flags
32 );
33
35 Send the block status command to the NBD server.
36
37 To check if the command completed, call nbd_aio_command_completed(3).
38 Or supply the optional "completion_callback" which will be invoked as
39 described in "Completion callbacks" in libnbd(3).
40
41 Other parameters behave as documented in nbd_block_status(3).
42
43 By default, libnbd will reject attempts to use this function with
44 parameters that are likely to result in server failure, such as
45 requesting an unknown command flag. The nbd_set_strict_mode(3)
46 function can be used to alter which scenarios should await a server
47 reply rather than failing fast.
48
50 This call returns the 64 bit cookie of the command. The cookie is ≥ 1.
51 Cookies are unique (per libnbd handle, not globally).
52
54 On error -1 is returned.
55
56 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
57 of the error.
58
59 The following parameters must not be NULL: "h". For more information
60 see "Non-NULL parameters" in libnbd(3).
61
63 The handle must be connected with the server, otherwise this call will
64 return an error.
65
67 This function first appeared in libnbd 1.0.
68
69 If you need to test if this function is available at compile time check
70 if the following macro is defined:
71
72 #define LIBNBD_HAVE_NBD_AIO_BLOCK_STATUS 1
73
75 nbd_aio_command_completed(3), nbd_block_status(3),
76 nbd_can_meta_context(3), nbd_create(3), nbd_set_strict_mode(3),
77 "Issuing asynchronous commands" in libnbd(3), libnbd(3).
78
80 Eric Blake
81
82 Richard W.M. Jones
83
85 Copyright Red Hat
86
88 This library is free software; you can redistribute it and/or modify it
89 under the terms of the GNU Lesser General Public License as published
90 by the Free Software Foundation; either version 2 of the License, or
91 (at your option) any later version.
92
93 This library is distributed in the hope that it will be useful, but
94 WITHOUT ANY WARRANTY; without even the implied warranty of
95 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
96 Lesser General Public License for more details.
97
98 You should have received a copy of the GNU Lesser General Public
99 License along with this library; if not, write to the Free Software
100 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
101 02110-1301 USA
102
103
104
105libnbd-1.16.5 2023-09-26 nbd_aio_block_status(3)