nbd_aio_flush(3)

🌸 nbd_aio_flush(3) 🌸

✨ NAME ✨

nbd_aio_flush β€” send flush command to the NBD server. welcome to the LIBNBD manual, bestie, we're so back πŸ’–

πŸ’– SYNOPSIS πŸ’–

        #include <libnbd.h>

        typedef struct {
          int (*callback) (void *user_data, int *error);
          void *user_data;
          void (*free) (void *user_data);
        } nbd_completion_callback;

        int64_t nbd_aio_flush (
                  struct nbd_handle *h,
                  nbd_completion_callback completion_callback,
                  uint32_t flags
                );

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this one issues the flush command to the NBD server. iconic behavior, no notes πŸ’…

to check if the command completed, call nbd_aio_command_completed(3) β€” that's your vibe check. or supply the optional completion_callback, which will be invoked as described in "Completion callbacks" in libnbd(3).

other parameters behave as documented in nbd_flush(3). periodt 🫢

🌈 RETURN VALUE 🌈

this call returns the 64 bit cookie of the command. the cookie is β‰₯ 1. cookies are unique (per libnbd handle, not globally). iykyk πŸ“

πŸ’€ ERRORS πŸ’€

on error -1 is returned. tragic, but at least it's documented 😭

refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error.

the following parameters must not be NULL: h. for more information see "Non-NULL parameters" in libnbd(3).

πŸ“ NOTES πŸ“

🚨 Strict call 🚨

by default, libnbd will reject attempts to use this function with parameters that are likely to result in server failure, such as requesting an unknown command flag. the nbd_set_strict_mode(3) function can be used to alter which scenarios should await a server reply rather than failing fast. strict mode said "not today" πŸ’€βœ¨

πŸ‘‘ HANDLE STATE πŸ‘‘

nbd_aio_flush can be called when the handle is in the following state:

  • Handle created, before connecting β€” ❌ error
  • Connecting β€” ❌ error
  • Connecting & handshaking (opt_mode) β€” ❌ error
  • Connected to the server β€” βœ… allowed
  • Connection shut down β€” ❌ error
  • Handle dead β€” ❌ error

so basically: be connected, bestie. that's the whole mood πŸ‘‘πŸ’…

⭐ VERSION ⭐

this function first appeared in libnbd 1.0.

if you need to test if this function is available at compile time check if the following macro is defined:

        #define LIBNBD_HAVE_NBD_AIO_FLUSH 1

πŸŽ€ SEE ALSO πŸŽ€

🫢 AUTHORS 🫢

  • Eric Blake
  • Richard W.M. Jones

Copyright Red Hat

πŸ“œ LICENSE πŸ“œ

the legal bit, unchanged because we do not mess with legal tea:

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA


mwah πŸ’‹ that's the whole page, bestie. this one comes from libnbd-1.25.8, dated 2026-10-13, and it's the nbd_aio_flush(3) page. byeee 🫢✨

πŸ“¦ where this page comes from