nbd_get_nr_meta_contexts(3)
π nbd_get_nr_meta_contexts β like, how many meta contexts did we even ask for?? (this is a libnbd(3) manpage, bestie)
okay so bestie, real talk: this is a libnbd function and its whole entire job is telling you how many metadata contexts you've queued up in your request list. that's it. that's the vibe. β¨
πΈ SYNOPSIS πΈ
#include <libnbd.h>
ssize_t nbd_get_nr_meta_contexts (
struct nbd_handle *h
);
π¦ DESCRIPTION π¦
so during connection, libnbd can negotiate zero or more metadata contexts with the server. no cap. and what even are metadata contexts? they're features β like "base:allocation" β that describe the info returned by the nbd_block_status_64(3) command. for "base:allocation" specifically, that info is whether blocks of data are allocated, zero, or sparse. iconic behavior honestly.
this command returns how many meta contexts have been added to the list that you're requesting from the server via nbd_add_meta_context(3). π
β οΈ heads up bestie: the server is not obligated to honor all of your requests. like, it can just say no. to see what it actually supports, go check nbd_can_meta_context(3). iykyk π
π RETURN VALUE π
this call returns an integer size β₯ 0. slay. π«Ά
π ERRORS π
on error, -1 is returned. rough, i know.
refer to "ERROR HANDLING" in libnbd(3) for how to get further details of the error.
also these parameters must not be NULL: "h". like, literally don't. for more info see "Non-NULL parameters" in libnbd(3).
β VERSION β
this function first appeared in libnbd 1.6. vintage era honestly. π§
if you need to test whether this function is available at compile time, check if the following macro is defined:
#define LIBNBD_HAVE_NBD_GET_NR_META_CONTEXTS 1
π SEE ALSO π
nbd_add_meta_context(3)nbd_block_status_64(3)nbd_can_meta_context(3)nbd_clear_meta_contexts(3)nbd_create(3)nbd_get_meta_context(3)libnbd(3)
the whole friend group, fr fr. π
π AUTHORS π
Eric Blake
Richard W.M. Jones
π 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
okay that's the whole page bestie!! this one's from libnbd-1.25.8, dated 2026-10-13, and it lives in section 3 of the manual β go forth and count those meta contexts πβ¨
π¦ 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