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 (struct nbd_handle *h,
27 uint64_t count,
28 uint64_t offset,
29 nbd_extent_callback extent_callback,
30 nbd_completion_callback completion_callback,
31 uint32_t flags);
32
34 Send the block status command to the NBD server.
35
36 To check if the command completed, call nbd_aio_command_completed(3).
37 Or supply the optional "completion_callback" which will be invoked as
38 described in "Completion callbacks" in libnbd(3).
39
40 Other parameters behave as documented in nbd_block_status(3).
41
43 This call returns the 64 bit cookie of the command. The cookie is ≥ 1.
44 Cookies are unique (per libnbd handle, not globally).
45
47 On error "-1" is returned.
48
49 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
50 of the error.
51
53 The handle must be connected and finished handshaking with the server,
54 otherwise this call will return an error.
55
57 This function first appeared in libnbd 1.0.
58
59 If you need to test if this function is available at compile time check
60 if the following macro is defined:
61
62 #define LIBNBD_HAVE_NBD_AIO_BLOCK_STATUS 1
63
65 nbd_aio_command_completed(3), nbd_block_status(3),
66 nbd_can_meta_context(3), nbd_create(3), "Issuing asynchronous commands"
67 in libnbd(3), libnbd(3).
68
70 Eric Blake
71
72 Richard W.M. Jones
73
75 Copyright (C) 2019 Red Hat Inc.
76
78 This library is free software; you can redistribute it and/or modify it
79 under the terms of the GNU Lesser General Public License as published
80 by the Free Software Foundation; either version 2 of the License, or
81 (at your option) any later version.
82
83 This library is distributed in the hope that it will be useful, but
84 WITHOUT ANY WARRANTY; without even the implied warranty of
85 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
86 Lesser General Public License for more details.
87
88 You should have received a copy of the GNU Lesser General Public
89 License along with this library; if not, write to the Free Software
90 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
91 02110-1301 USA
92
93
94
95libnbd-1.3.7 2020-04-23 nbd_aio_block_status(3)