LLAPI_POOL_PIN_FILE(3)
π LLAPI_POOL_PIN_FILE(3) π
okay bestie, welcome to the Lustre Library Functions corner of the manual π this is the one about pinning a Lustre file to an OST pool, and honestly? it's giving "tiny function, big responsibility."
β¨ NAME β¨
llapi_pool_pin_fd, llapi_pool_pin_file, llapi_pool_pin_fid β pin a Lustre file to an OST pool π
β¨ SYNOPSIS β¨
#include <lustre/lustreapi.h>
int llapi_pool_pin_fd(int fd, const char *pool_name);
int llapi_pool_pin_file(const char *path, const char *pool_name);
int llapi_pool_pin_fid(const char *lustre_dir, const struct lu_fid *fid,
const char *pool_name);
three little functions, one big vibe. let's get into it π¦
β¨ DESCRIPTION β¨
So. The llapi_pool_pin_*(3) functions are all about manipulating the Lustre lustre.pin extended attribute of a file, specifically to record whether that file is pinned to a particular OST pool. no cap.
Pool pins get stored as YAML entries that look exactly like this:
pool: pool_name
β¦inside the lustre.pin attribute. and here's the cute part: that attribute can also hold other entries, like the hsm pins used by the PCC subsystem. so multiple pool pins and PCC pins can all coexist in the same attribute like the besties they are. π
Now, llapi_pool_pin_fd(), llapi_pool_pin_file() and llapi_pool_pin_fid() add a pool entry for the specified pool_name to the lustre.pin extended attribute of the referenced file β but only if it's not already there. if the entry already exists, they leave the attribute completely unchanged. respectful. iconic. β¨
If you're looking for the unpinning squad, llapi_pool_unpin_fd(), llapi_pool_unpin_file() and llapi_pool_unpin_fid() are documented over in llapi_pool_unpin_file(3) π«Ά
And if you just wanna know whether something's pinned (the nosy bestie energy), llapi_pool_is_pinned_fd(), llapi_pool_is_pinned_file() and llapi_pool_is_pinned_fid() live in llapi_pool_is_pinned_file(3).
One more thing, and this is important so listen up π β the pool_name parameter can optionally be qualified with a filesystem name using the "fsname.pool" notation that Lustre tools commonly use. when that happens, the "fsname." prefix gets silently discarded before the pool name is stored or compared, and only the unqualified pool name is recorded in the lustre.pin attribute. periodt. it just disappears. no drama, no error, poof π¨
β¨ RETURN VALUES β¨
- The
llapi_pool_pin_*()functions return0on success πβ¨ - On failure they return a negative
errnovalue and seterrnoto the corresponding error code. so yeah, check both, bestie.
β¨ ERRORS β¨
Errors coming from llapi_pool_name_validate(3) will be returned on malformed pool names. (basically if your pool name is cursed, that function has opinions and you'll hear about them π)
EINVALβ An invalid argument was specified.
β¨ EXAMPLES β¨
here's the whole thing in action, look at her go πΈ
#include <lustre/lustreapi.h>
if (llapi_pool_pin_file(path, pool_name) < 0) {
perror("llapi_pool_pin_file");
/* handle error based on errno */
}
see that perror? that's your bestie telling you what went wrong. always handle your errors, we don't do silent failures in this house π
β¨ AVAILABILITY β¨
The llapi_pool_pin_fd(), llapi_pool_pin_file(), llapi_pool_pin_fid() functions are part of the lustre(7) user application interface library since release 2.18.0 β
β¨ SEE ALSO β¨
llapi_pool_is_pinned_file(3)llapi_pool_name_validate(3)llapi_pool_unpin_file(3)lustre(7)lustreapi(7)
and that's the whole page babes π¦ this gem shipped as part of the Lustre User API, dated 2026-08-23 β go forth and pin responsibly, mwah π πβ¨
π¦ 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