LLAPI\_GET\_FSNAME\_INSTANCE(3) Lustre Library Functions LLAPI\_GET\_FSNAME\_INSTANCE(3)

# [NAME](#NAME)

llapi\_get\_fsname\_instance, llapi\_get\_fsname, llapi\_get\_instance, llapi\_getname - get the client filesystem name and instance

# [SYNOPSIS](#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](#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)](/man/enterprise-packages/lustre/llapi_get_fsname.3) or [**llapi\_get\_instance**(3)](/man/enterprise-packages/lustre/llapi_get_instance.3) function can be used. The [**llapi\_getname**(3)](/man/enterprise-packages/lustre/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](#RETURN_VALUES)

**0**

on success, or

[-ve](#ve)

error code on failure and sets errno appropriately.

# [ERRORS](#ERRORS)

[**EINVAL**](#EINVAL)

Invalid filesystem information found.

[**ENAMETOOLONG**](#ENAMETOOLONG)

The *fsname\_len*, *instance\_len*, or *namelen* buffer length was not large enough to hold the string.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_get\_fsname\_instance()**, **llapi\_get\_fsname()**, **llapi\_get\_instance()**, and **llapi\_getname()** are part of the [**lustre**(7)](/man/enterprise-packages/lustre/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](#SEE_ALSO)

[**lfs-getname**(1)](/man/enterprise-packages/lustre/lfs-getname.1), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2024-08-26 Lustre User API

---

Document: llapi_get_fsname(3) from lustre 2.17.59-r1 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
