LLAPI\_FID\_TO\_HANDLE(3) Lustre Library Functions LLAPI\_FID\_TO\_HANDLE(3)

# [NAME](#NAME)

llapi\_fid\_to\_handle - allocate an NFS handle for File Identifier

# [SYNOPSIS](#SYNOPSIS)

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

```
int llapi_fid_to_handle(struct file_handle **handle, struct lu_fid *fid);
```

# [DESCRIPTION](#DESCRIPTION)

**llapi\_fid\_to\_handle()** allocates an NFS file *handle* for the File Identifier given by *fid* for later use by [**open\_by\_handle\_at**(2)](/man/enterprise-packages/lustre/open_by_handle_at.2). This is similar to the [**name\_to\_handle\_at**(2)](/man/enterprise-packages/lustre/name_to_handle_at.2) function, and is useful for Lustre-specific tools and interfaces. While the [**llapi\_fid\_to\_handle**(3)](/man/enterprise-packages/lustre/llapi_fid_to_handle.3) function does not require root access itself, the [**open\_by\_handle\_at**(2)](/man/enterprise-packages/lustre/open_by_handle_at.2) function **does** require root access since this bypasses all pathname-derived file access permissions. The memory allocated for *handle* and returned to the caller must be freed with [*free*(2)](/man/enterprise-packages/lustre/free.2).

# [RETURN VALUES](#RETURN_VALUES)

returns 0 on success or a negative errno on failure.

# [ERRORS](#ERRORS)

[**-ENOMEM**](#ENOMEM)

No memory was available for allocating *handle*.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_fid\_to\_handle()** is part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library since release 2.16.0

# [SEE ALSO](#SEE_ALSO)

[**name\_to\_handle**(2)](/man/enterprise-packages/lustre/name_to_handle.2), [**open\_by\_handle\_at**(2)](/man/enterprise-packages/lustre/open_by_handle_at.2), [**free**(3)](/man/enterprise-packages/lustre/free.3), [**llapi\_fid\_parse**(3)](/man/enterprise-packages/lustre/llapi_fid_parse.3), [**llapi\_fid2path**(3)](/man/enterprise-packages/lustre/llapi_fid2path.3), [**llapi\_path2fid**(3)](/man/enterprise-packages/lustre/llapi_path2fid.3), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7),

2024-08-23" Lustre User API

---

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