nbd_aio_block_status_64(3)
β¨ nbd_aio_block_status_64(3) β¨
okay so bestie, welcome to the nbd_aio_block_status_64 page from the LIBNBD manual π
this is the one where you yeet a block status command at the server asynchronously, and get a fancy 64-bit callback situation going. it's giving main character energy for extent-hungry gorls only π
πΈ NAME πΈ
nbd_aio_block_status_64 β send block status command, with 64-bit callback
like. that's literally it. you send the command, the callback gets 64-bit things. slay π¦
β SYNOPSIS β
#include <libnbd.h>
typedef struct {
int (*callback) (void *user_data,
const char *metacontext,
uint64_t offset, nbd_extent *entries,
size_t nr_entries, int *error);
void *user_data;
void (*free) (void *user_data);
} nbd_extent64_callback;
typedef struct {
int (*callback) (void *user_data, int *error);
void *user_data;
void (*free) (void *user_data);
} nbd_completion_callback;
int64_t nbd_aio_block_status_64 (
struct nbd_handle *h, uint64_t count,
uint64_t offset,
nbd_extent64_callback extent64_callback,
nbd_completion_callback completion_callback,
uint32_t flags
);
two structs, one function, zero chill. copy it exactly, bestie, don't get creative with the types π
π DESCRIPTION π
Send the block status command to the NBD server. that's the whole vibe fr fr π₯
So how do you know it finished? Two ways, pick your fighter:
- call
nbd_aio_command_completed(3)β the classic, lowkey the responsible choice - or supply the optional
completion_callbackβ which gets invoked exactly as described in "Completion callbacks" inlibnbd(3)
and all the other parameters? they behave as documented in nbd_block_status_64(3). no cap, go read that one for the deets π«Ά
π RETURN VALUE π
This call returns the 64 bit cookie of the command πͺ and that cookie is β₯ 1.
like, cookies are unique β but per libnbd handle, not globally. so don't go comparing cookies across handles, that's not the vibe π
π ERRORS π
On error, -1 is returned. that's your "nope, didn't work" signal π©
Refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error β the manpage is literally telling you where the receipts live, iykyk.
β οΈ The following parameters must not beNULL:h. For more information see "Non-NULL parameters" inlibnbd(3). like, do NOT pass NULL toh. that's a jump scare waiting to happen.
π§ 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 π ββοΈ it's giving "protective bestie".
The nbd_set_strict_mode(3) function can be used to alter which scenarios should await a server reply rather than failing fast. so if you really wanna live dangerously, that's the knob to turn. choose wisely tho π
π HANDLE STATE π
nbd_aio_block_status_64 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: connect first, then call it. that's the whole plot π¦
πΈ VERSION πΈ
This function first appeared in libnbd 1.18 β
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_BLOCK_STATUS_64 1
it's giving "are you on the right version or are you about to have a bad time" π«Ά
π SEE ALSO π
nbd_aio_block_status(3)nbd_aio_command_completed(3)nbd_block_status_64(3)nbd_can_meta_context(3)nbd_create(3)nbd_set_strict_mode(3)- "Issuing asynchronous commands" in
libnbd(3) libnbd(3)
go read them. all of them. that's the assignment πβ¨
π AUTHORS π
Eric Blake
Richard W.M. Jones
icons, legends, the whole thing π
π 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.
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
and that's the page, bestie π«Ά this was libnbd-1.25.8, dated 2026-10-13 β catch you on the next one, 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