1nbd_flush(3)                        LIBNBD                        nbd_flush(3)
2
3
4

NAME

6       nbd_flush - send flush command to the NBD server
7

SYNOPSIS

9        #include <libnbd.h>
10
11        int nbd_flush (struct nbd_handle *h, uint32_t flags);
12

DESCRIPTION

14       Issue the flush command to the NBD server.  The function should return
15       when all write commands which have completed have been committed to
16       permanent storage on the server.  Note this will generally return an
17       error if nbd_can_flush(3) is false.
18
19       The "flags" parameter must be 0 for now (it exists for future NBD
20       protocol extensions).
21
22       By default, libnbd will reject attempts to use this function with
23       parameters that are likely to result in server failure, such as
24       requesting an unknown command flag.  The nbd_set_strict_mode(3)
25       function can be used to alter which scenarios should await a server
26       reply rather than failing fast.
27

RETURN VALUE

29       If the call is successful the function returns 0.
30

ERRORS

32       On error "-1" is returned.
33
34       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
35       of the error.
36

HANDLE STATE

38       The handle must be connected with the server, otherwise this call will
39       return an error.
40

VERSION

42       This function first appeared in libnbd 1.0.
43
44       If you need to test if this function is available at compile time check
45       if the following macro is defined:
46
47        #define LIBNBD_HAVE_NBD_FLUSH 1
48

SEE ALSO

50       nbd_aio_flush(3), nbd_can_flush(3), nbd_create(3),
51       nbd_set_strict_mode(3), libnbd(3).
52

AUTHORS

54       Eric Blake
55
56       Richard W.M. Jones
57
59       Copyright (C) 2019-2021 Red Hat Inc.
60

LICENSE

62       This library is free software; you can redistribute it and/or modify it
63       under the terms of the GNU Lesser General Public License as published
64       by the Free Software Foundation; either version 2 of the License, or
65       (at your option) any later version.
66
67       This library is distributed in the hope that it will be useful, but
68       WITHOUT ANY WARRANTY; without even the implied warranty of
69       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
70       Lesser General Public License for more details.
71
72       You should have received a copy of the GNU Lesser General Public
73       License along with this library; if not, write to the Free Software
74       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
75       02110-1301 USA
76
77
78
79libnbd-1.10.1                     2021-10-25                      nbd_flush(3)
Impressum