LLAPI_SEARCH_TGT(3)
π LLAPI_SEARCH_TGT π
okay bestie, pull up a chair, because we're diving into LLAPI_SEARCH_TGT(3) β that's section 3 of the manual, under Lustre Library Functions, and it's lowkey one of those little utility pages that quietly does a LOT. β¨
It's basically a vibe check for your filesystem targets: is this OST or MDT actually in this pool or what? π Three functions, one job, zero drama.
π NAME π
llapi_search_tgt, llapi_search_mdt, llapi_search_ost β the trio that verifies an OST or MDT is in a specified pool. fr fr, that's the whole plot.
πΈ SYNOPSIS πΈ
first things first, you gotta bring the header in:
#include <lustre/lustreapi.h>
then it's giving:
int llapi_search_tgt(const char *fsname, const char *pool_name,
const char *tgt_name, bool is_mdt);
int llapi_search_mdt(const char *fsname, const char *pool_name,
const char *tgt_name);
int llapi_search_ost(const char *fsname, const char *pool_name,
const char *tgt_name);
three besties, same energy, slightly different jobs. π«Ά
β¨ DESCRIPTION β¨
so llapi_search_tgt() is the main character here. it verifies that the tgt_name you handed it is a valid MDT or OST β which one depends on whether is_mdt is true or false, respectively π
β inside the filesystem named fsname, and (if you specified one) inside the pool named pool_name of that filesystem.
the ground rules, because there are some, and we respect them:
- At least
fsnamemust be non-NULL. non-negotiable. it's the bare minimum, truly. pool_namemay beNULLif you're just checking that the target exists. no pool needed, just vibes.tgt_namemay beNULLif you're only checking thatpool_nameexists. icon behaviour, honestly.
and then there's the dynamic duo: llapi_search_mdt() and llapi_search_ost(). these two are simple convenience/compatibility wrappers around llapi_search_tgt() that just set is_mdt appropriately for the target type you want. like, they're not doing anything new, they're just saving you a bool. slay. π¦
π₯ RETURN VALUES π₯
okay so here's what you actually get back, and this part matters so pay attention bestie:
- returns
1iftgt_name(orpool_nameiftgt_nameisNULL) is found in the specified pool (or filesystem ifpool_nameisNULL). found it, ate, periodt. π - returns
0iftgt_name(orpool_name) is not found in the specified pool (or filesystem). not here, not today. π - returns a negative errno if an error occurred β and in that case,
errnois also set appropriately. so yeah, check both.
π ERRORS π
when things go wrong, here's the receipts:
EINVALβfsnameisNULLor zero-length, or bothpool_nameandtgt_nameareNULL. like, you gave it literally nothing to work with. πENOENTβpool_nameis specified but is not part offsname. it said what it said.
π AVAILABILITY π
llapi_search_tgt(), llapi_search_mdt() and llapi_search_ost() are part of the lustre(7) user application interface library since release 2.4.0. so they've been around. they're not new here, they're veterans. β
π SEE ALSO π
go read these next, iykyk:
llapi_pool_name_verify(3)lustre(7)lustreapi(7)
and that's the whole page, bestie!! π§ thank you for coming to my ted talk. this gem came to you courtesy of Lustre User API, dated 2024-08-28, and yes we are absolutely stanning a manpage. go check your targets, stay in your pool, and remember: fsname non-NULL or it's over. πβ¨πΈ
π¦ where this page comes from
- ubuntu stonking: lustre-client-utils 2.17.58+dfsg-0ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms