LLAPI_POOL_NAME_VALIDATE(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’– LLAPI_POOL_NAME_VALIDATE(3) β€” Lustre Library Functions πŸ’–

okay bestie, so this is a page from section 3 of the Lustre Library Functions manual, and it's literally all about checking that a pool name is not a mess πŸ’…


✨ NAME ✨

llapi_pool_name_validate() β€” the lil vibe check that makes sure your pool name only has valid characters in it πŸŽ€


✨ SYNOPSIS ✨

#include <lustre/lustreapi.h>

int llapi_pool_name_validate(const char **pool_name);

🌸 DESCRIPTION 🌸

so <pink>llapi_pool_name_validate() is the function you call when you need to verify that every character in *pool_name* is alphanumeric, or a '-', or an '_'β€” that's it, that's the whole guest list, no plus-ones 🚫 and it also has to be **not longer than**LOV_MAXPOOLNAME` (15) bytes in length, not counting the NUL terminator. like, fifteen bytes bestie, that's the limit, periodt βœ‹

here's the tea though πŸ“: if pool_name is in the form fsname.pool_name, then the leading fsname. part gets removed, and when the function returns, the pool_name pointer will only point at the pool name itself. why? because that makes pool_name suitable for use in filesystem pool identifiers, duh πŸ’β€β™€οΈ

and if losing that leading fsname. component is not the move for you, if it's giving "please don't touch my string," then you should use llapi_name_validate(3) to verify the pool name instead. iykyk πŸ¦‹


⭐ RETURN VALUE ⭐

llapi_pool_name_validate() returns 0 on success πŸŽ‰ β€” or a negative errno value on failure 😭


πŸ”₯ ERRORS πŸ”₯

  • EINVAL β€” the name you handed over had an illegal character in it. rude. πŸ’€
  • ENAMETOOLONG β€” the name went past LOV_MAXPOOLNAME characters with no NUL terminator to save it. it simply would not stop. 😭
  • ENXIO β€” the name was NULL or empty. nothing. a void. an empty plate. πŸ™ˆ

πŸ’œ EXAMPLES πŸ’œ

checking if pool_name can actually be used as a pool identifier, let's go πŸ‘‘

#include <string.h>
#include <lustre/lustreapi.h>

int main(int argc, char *argv[])
{
        char pool_name[] = "newfs123.testpool";

        rc = llapi_pool_name_validate(&pool_name);
        if (rc < 0) {
                fprintf(stderr, "%s: pool name '%s' invalid: %s\n",
                        argv[1], pool_name, strerror(errno));
                return rc;
        }
}

🌈 AVAILABILITY 🌈

llapi_pool_name_validate has been part of the lustre(7) filesystem package since release 2.18.0 β€” so it's been serving looks for a minute now πŸ‘‘


🫢 SEE ALSO 🫢

llapi_name_validate(3), lustreapi(7)


and that's the whole page bestie, no cap 🧚 this lil rewrite came to you from the Lustre User API, dated 2026-08-23 β€” original LLAPI_POOL_NAME_VALIDATE(3) energy, just with way more sparkle ✨ mwah, go validate those pool names πŸ’–

πŸ“¦ where this page comes from