OS Manuals

llapi_get_instance(3)

llapi_get_fsname_instance, llapi_get_fsname, llapi_get_instance, llapi_getname - get the client filesystem name and instance

LLAPI_GET_FSNAME_INSTANCE(3) Lustre Library Functions LLAPI_GET_FSNAME_INSTANCE(3)

llapi_get_fsname_instance, llapi_get_fsname, llapi_get_instance, llapi_getname - get the client filesystem name and instance

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <lustre/lustreapi.h>
int llapi_getname(const char *path, char *name, size_t namelen);
int llapi_get_fsname_instance(const char *path, char *fsname,
                              size_t fsname_len, char *instance,
                              size_t instance_len);
int llapi_get_fsname(const char *path, char *fsname,
                     size_t fsname_len);
int llapi_get_instance(const char *path, char *instance,
                       size_t instance_len);

llapi_get_fsname_instance() retrieves the filesystem fsname and instance for the specified path and stores them in the fsname and instance buffers respectively, each of which can respectively hold at least fsname_len (at least LUSTRE_MAXFSNAME bytes), and instance_len (at least LUSTRE_MAXINSTANCE bytes). If only the fsname or instance identifier is needed, then the respective llapi_get_fsname(3) or llapi_get_instance(3) function can be used. The llapi_getname(3) function returns the combined fsname-instance string.

The filesystem fsname is a short name like 'testfs' or 'lfs2g' used to identify the filesystem on the clients and servers for mounting and configuration. The instance is a client-unique temporary identifier like 'ffff8803c9c0f000' that differentiates multiple mounts of the same filesystem on the same client. The instance is not guaranteed to be unique between different clients, nor is it expected to be the same for repeated mounts on the same client.

The filesystem identifier is used in client-side parameters, like mdc.fsname-MDT0000-mdc-instance.max_rpcs_in_flight for MDC and OSC devices, or llite.fsname-instance.max_cached_mb and similar for llite tunable values and statistics.

0
on success, or
error code on failure and sets errno appropriately.

Invalid filesystem information found.
The fsname_len, instance_len, or namelen buffer length was not large enough to hold the string.

llapi_get_fsname_instance(), llapi_get_fsname(), llapi_get_instance(), and llapi_getname() are part of the lustre(7) user application interface library. llapi_get_fsname_instance and llapi_get_fsname were added in release 2.14.0. llapi_get_instance and llapi_getname were added in release 2.2.0.

lfs-getname(1), lustreapi(7)

2024-08-26 Lustre User API

lustre 2.17.60-r0 · enterprise-packages · ingested 2026-10-22