1nbd_aio_block_status(3)             LIBNBD             nbd_aio_block_status(3)
2
3
4

NAME

6       nbd_aio_block_status - send block status command to the NBD server
7

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

HANDLE STATE

53       The handle must be connected and finished handshaking with the server,
54       otherwise this call will return an error.
55

VERSION

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

SEE ALSO

65       "Issuing asynchronous commands" in libnbd(3), nbd_can_meta_context(3),
66       nbd_block_status(3), nbd_create(3), libnbd(3).
67

AUTHORS

69       Eric Blake
70
71       Richard W.M. Jones
72
74       Copyright (C) 2019 Red Hat Inc.
75

LICENSE

77       This library is free software; you can redistribute it and/or modify it
78       under the terms of the GNU Lesser General Public License as published
79       by the Free Software Foundation; either version 2 of the License, or
80       (at your option) any later version.
81
82       This library is distributed in the hope that it will be useful, but
83       WITHOUT ANY WARRANTY; without even the implied warranty of
84       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
85       Lesser General Public License for more details.
86
87       You should have received a copy of the GNU Lesser General Public
88       License along with this library; if not, write to the Free Software
89       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
90       02110-1301 USA
91
92
93
94libnbd-1.2.1                      2019-11-14           nbd_aio_block_status(3)
Impressum