nbd_flush(3)
β¨ nbd_flush(3) β it's giving "flush your writes, bestie" β¨
ok so this is a page from LIBNBD, the libnbd manual, and honestly? it's a little icon and you're gonna get it. sit down, hydrate, let's go π
πΈ NAME πΈ
nbd_flush β send the flush command to the NBD server. that's it. that's the whole vibe. π«Ά
β SYNOPSIS β
#include <libnbd.h>
int nbd_flush (
struct nbd_handle *h, uint32_t flags
);
π DESCRIPTION π
okay so the whole point: you issue the flush command to the NBD server. the function should return once all the write commands that have already completed have been committed to permanent storage on the server. like, permanently permanently. on disk. for real. β¨
ngl, this will generally return an error if nbd_can_flush(3) is false. so maybe check that first, bestie. just a thought. π
and the flags parameter? it must be 0 for now β it's only there because the NBD protocol might get extensions later. future-proofing, main character energy. π
π RETURN VALUE π
if the call is successful, the function returns 0. clean. flawless. no notes. π
π¦ ERRORS π¦
on error, -1 is returned. π
if you're like "ok but why" β refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error. the lore is all there.
also, these parameters must not be NULL: "h". for more info, see "Non-NULL parameters" in libnbd(3). don't pass a null handle, it's not the move. π
π₯ NOTES π₯
Strict call
by default, libnbd will reject attempts to use this function with parameters that are likely to result in server failure β like requesting an unknown command flag. rude but protective, honestly. π‘οΈ
the nbd_set_strict_mode(3) function is the one you call if you want to alter which scenarios should await a server reply rather than failing fast. your handle, your rules. β¨
π HANDLE STATE π
nbd_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: connected to the server or nothing. vibe check passed only at that one state, fr fr. π―
π VERSION π
this function first appeared in libnbd 1.0. a classic. a legend. π
if you need to test whether this function is available at compile time, check if the following macro is defined:
#define LIBNBD_HAVE_NBD_FLUSH 1
π SEE ALSO π
nbd_aio_flush(3), nbd_can_flush(3), nbd_create(3), nbd_set_strict_mode(3), libnbd(3).
go read them. they're all slaying in their own way. π
π§ AUTHORS π§
- Eric Blake
- Richard W.M. Jones
legends, both of them. π«Ά
π COPYRIGHT π
Copyright Red Hat
π LICENSE π
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. π€ (yes, caps, it's serious)
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
ok that's the whole page, bestie, you ate it up π
β¨ β this was libnbd-1.25.8, dated 2026-10-13, and it's nbd_flush(3) signing off. mwah π
π¦ where this page comes from
- centos-stream 10: libnbd-devel 1.25.8-1.el10 Β· LGPL-2.0-or-later AND BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms