1nbd_aio_flush(3)                    LIBNBD                    nbd_aio_flush(3)
2
3
4

NAME

6       nbd_aio_flush - send flush command to the NBD server
7

SYNOPSIS

9        #include <libnbd.h>
10
11        typedef struct {
12          int (*callback) (void *user_data, int *error);
13          void *user_data;
14          void (*free) (void *user_data);
15        } nbd_completion_callback;
16
17        int64_t nbd_aio_flush (struct nbd_handle *h,
18                               nbd_completion_callback completion_callback,
19                               uint32_t flags);
20

DESCRIPTION

22       Issue the flush command to the NBD server.
23
24       To check if the command completed, call nbd_aio_command_completed(3).
25       Or supply the optional "completion_callback" which will be invoked as
26       described in "Completion callbacks" in libnbd(3).
27
28       Other parameters behave as documented in nbd_flush(3).
29
30       By default, libnbd will reject attempts to use this function with
31       parameters that are likely to result in server failure, such as
32       requesting an unknown command flag.  The nbd_set_strict_mode(3)
33       function can be used to alter which scenarios should await a server
34       reply rather than failing fast.
35

RETURN VALUE

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

ERRORS

41       On error "-1" is returned.
42
43       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
44       of the error.
45
46       The following parameters must not be NULL: "h".  For more information
47       see "Non-NULL parameters" in libnbd(3).
48

HANDLE STATE

50       The handle must be connected with the server, otherwise this call will
51       return an error.
52

VERSION

54       This function first appeared in libnbd 1.0.
55
56       If you need to test if this function is available at compile time check
57       if the following macro is defined:
58
59        #define LIBNBD_HAVE_NBD_AIO_FLUSH 1
60

SEE ALSO

62       nbd_aio_command_completed(3), nbd_can_flush(3), nbd_create(3),
63       nbd_flush(3), nbd_set_strict_mode(3), "Issuing asynchronous commands"
64       in libnbd(3), libnbd(3).
65

AUTHORS

67       Eric Blake
68
69       Richard W.M. Jones
70
72       Copyright (C) 2019-2021 Red Hat Inc.
73

LICENSE

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