LLAPI_GET_FSNAME_INSTANCE(3)

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

SYNOPSIS
#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);

DESCRIPTION

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.

RETURN VALUES

0   on success, or

-ve error code on failure and sets errno appropriately.

ERRORS

EINVAL
    Invalid filesystem information found.

ENAMETOOLONG
    The fsname_len, instance_len, or namelen buffer length was not large enough to hold the string.

AVAILABILITY
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.

SEE ALSO
lfs-getname(1), lustreapi(7)