1nbd_aio_block_status_filter(3)      LIBNBD      nbd_aio_block_status_filter(3)
2
3
4

NAME

6       nbd_aio_block_status_filter - send filtered block status command to the
7       NBD server
8

SYNOPSIS

10        #include <libnbd.h>
11
12        typedef struct {
13          int (*callback) (void *user_data,
14                           const char *metacontext,
15                           uint64_t offset, nbd_extent *entries,
16                           size_t nr_entries, int *error);
17          void *user_data;
18          void (*free) (void *user_data);
19        } nbd_extent64_callback;
20
21        typedef struct {
22          int (*callback) (void *user_data, int *error);
23          void *user_data;
24          void (*free) (void *user_data);
25        } nbd_completion_callback;
26
27        int64_t nbd_aio_block_status_filter (
28                  struct nbd_handle *h, uint64_t count,
29                  uint64_t offset, char **contexts,
30                  nbd_extent64_callback extent64_callback,
31                  nbd_completion_callback completion_callback,
32                  uint32_t flags
33                );
34

DESCRIPTION

36       Send a filtered block status command to the NBD server.
37
38       To check if the command completed, call nbd_aio_command_completed(3).
39       Or supply the optional "completion_callback" which will be invoked as
40       described in "Completion callbacks" in libnbd(3).
41
42       Other parameters behave as documented in nbd_block_status_filter(3).
43
44       By default, libnbd will reject attempts to use this function with
45       parameters that are likely to result in server failure, such as
46       requesting an unknown command flag.  The nbd_set_strict_mode(3)
47       function can be used to alter which scenarios should await a server
48       reply rather than failing fast.
49

RETURN VALUE

51       This call returns the 64 bit cookie of the command.  The cookie is ≥ 1.
52       Cookies are unique (per libnbd handle, not globally).
53

ERRORS

55       On error -1 is returned.
56
57       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
58       of the error.
59
60       The following parameters must not be NULL: "h", "contexts".  For more
61       information see "Non-NULL parameters" in libnbd(3).
62

HANDLE STATE

64       The handle must be connected with the server, otherwise this call will
65       return an error.
66

VERSION

68       This function first appeared in libnbd 1.18.
69
70       If you need to test if this function is available at compile time check
71       if the following macro is defined:
72
73        #define LIBNBD_HAVE_NBD_AIO_BLOCK_STATUS_FILTER 1
74

SEE ALSO

76       nbd_aio_block_status_64(3), nbd_aio_command_completed(3),
77       nbd_block_status_filter(3), nbd_can_block_status_payload(3),
78       nbd_can_meta_context(3), nbd_create(3), nbd_set_strict_mode(3),
79       "Issuing asynchronous commands" in libnbd(3), libnbd(3).
80

AUTHORS

82       Eric Blake
83
84       Richard W.M. Jones
85
87       Copyright Red Hat
88

LICENSE

90       This library is free software; you can redistribute it and/or modify it
91       under the terms of the GNU Lesser General Public License as published
92       by the Free Software Foundation; either version 2 of the License, or
93       (at your option) any later version.
94
95       This library is distributed in the hope that it will be useful, but
96       WITHOUT ANY WARRANTY; without even the implied warranty of
97       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
98       Lesser General Public License for more details.
99
100       You should have received a copy of the GNU Lesser General Public
101       License along with this library; if not, write to the Free Software
102       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
103       02110-1301 USA
104
105
106
107libnbd-1.18.1                     2023-10-31    nbd_aio_block_status_filter(3)
Impressum