LLAPI\_RMFID(3) Lustre Library Functions LLAPI\_RMFID(3)

# [NAME](#NAME)

llapi\_rmfid, llapi\_rmfid\_at - Remove files by their FIDs in Lustre.

# [SYNOPSIS](#SYNOPSIS)

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

```
int llapi_rmfid(const char *path, struct fid_array *fa);
int llapi_rmfid_at(int fd, struct fid_array *fa);
```

# [DESCRIPTION](#DESCRIPTION)

**llapi\_rmfid()** tries to remove *fa-&gt;fa\_nr* Lustre files by FIDs stored in *fa-&gt;fa\_fids* All file's hardlinks are subject to removal. This functionality is available only for root or regular users on filesystems mounted with *user\_fid2path* mount option to delete files that they own and are in a directory in which they have write permission.

**llapi\_rmfid\_at()** Is similar to *llapi\_rmfid.* It tries to remove Lustre files by FIDs stored in *fa-&gt;fa\_fids* where path or device is pointed by an already verified *fd.*

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_rmfid()** and **llapi\_rmfid\_at()** return 0 on success or a negative errno value on failure. Result for each file is stored in the corresponding *fa-&gt;fa\_fid\[N].f\_ver*

# [ERRORS](#ERRORS)

[**-ENOENT**](#ENOENT)

*file* does not exist.

[**-EBUSY**](#EBUSY)

file is open and can't be removed

[**-EPERM**](#EPERM)

The file cannot be open by user or CAP\_DAC\_READ\_SEARCH is not granted.

[**-EINVAL**](#EINVAL)

Invalid FID is passed

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

Not enough memory to process the request

[**-ENOTTY**](#ENOTTY)

*file* may not point to a Lustre filesystem mountpoint

# [AVAILABILITY](#AVAILABILITY)

**llapi\_rmfid()** and **llapi\_rmfid\_at()** is part of the [**lustre**(7)](/man/enterprise-packages/lustre/lustre.7) user application interface library since release 2.13.0

# [SEE ALSO](#SEE_ALSO)

[**llapi\_rmfid\_at**(3)](/man/enterprise-packages/lustre/llapi_rmfid_at.3), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2024-08-28 Lustre User API

---

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