| LLAPI_POOL_NAME_VALIDATE(3) | Lustre Library Functions | LLAPI_POOL_NAME_VALIDATE(3) |
NAME
llapi_pool_name_validate() - check pool name contains only valid characters
SYNOPSIS
#include <lustre/lustreapi.h>
int llapi_pool_name_validate(const char **pool_name);
DESCRIPTION
llapi_pool_name_validate() verifies that the characters in pool_name contain only alphanumeric characters, '-', and '_', and is not longer than LOV_MAXPOOLNAME (15) bytes in length (excluding NUL terminator). If pool_name is of the form fsname.pool_name then the leading fsname. part of the pool name is removed and the pool_name pointer will only point at the pool name upon return. This ensures that pool_name is suitable for use in filesystem pool identifiers. If the removal of the leading fsname. component of the pool name is undesirable, then llapi_name_validate(3) should be used to verify the pool name.
RETURN VALUE
llapi_pool_name_validate() returns 0 on success, or a negative errno value on failure.
ERRORS
- EINVAL
- The supplied name contained an illegal character.
- ENAMETOOLONG
- The supplied name exceeded LOV_MAXPOOLNAME characters without a NUL terminator.
- ENXIO
- The name was NULL or empty.
EXAMPLES
Check if pool_name can be used as a pool identifier.
#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 is part of the lustre(7) filesystem package since release 2.18.0.
SEE ALSO
| 2026-08-23 | Lustre User API |