LLAPI\_PCC\_DETACH\_FID\_FD(3) Lustre Library Functions LLAPI\_PCC\_DETACH\_FID\_FD(3)

# [NAME](#NAME)

llapi\_pcc\_detach\_fid\_fd, llapi\_pcc\_detach\_fid, llapi\_pcc\_detach\_fid\_str, llapi\_pcc\_detach\_file - detach the given file from PCC

# [SYNOPSIS](#SYNOPSIS)

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

```
int llapi_pcc_detach_fid_fd(int dirfd, const struct lu_fid *fid,
                            __u32 flags);
```

```
int llapi_pcc_detach_fid(const char *mntpath,
                         const struct lu_fid *fid, __u32 flags);
```

```
int llapi_pcc_detach_fid_str(const char *mntpath,
                             const char *fidstr, __u32 flags);
```

```
int llapi_pcc_detach_file(const char *path, __u32 flags);
```

# [DESCRIPTION](#DESCRIPTION)

**llapi\_pcc\_detach\_fid\_fd()**, **llapi\_pcc\_detach\_fid()**, **llapi\_pcc\_detach\_fid\_str()**, and **llapi\_pcc\_detach\_file()** detach a cached file from PCC by an ioctl on the directory or the file itself. The file is referenced by *fid*, *fidstr*, or *path*. The directory, which is usually a mount point that the copytool already has opened, is referenced by *dirfd*, *mntpath*, *path*. The detach flags are specified by *flags* argument, which is a **enum lu\_pcc\_detach\_flags** data structure, which contains the following values:

```
	PCC_DETACH_FL_NONE			= 0x0,
	PCC_DETACH_FL_UNCACHE		= 0x01,
	PCC_DETACH_FL_KNOWN_READWRITE	= 0x02,
	PCC_DETACH_FL_KNOWN_READONLY	= 0x04,
	PCC_DETACH_FL_CACHE_REMOVED	= 0x08,
```

[PCC\_DETACH\_FL\_NONE](#PCC_DETACH_FL_NONE)

means that detach the file from PCC yet retain the data copy on PCC backend.

[PCC\_DETACH\_FL\_UNCACHE](#PCC_DETACH_FL_UNCACHE)

means that remove the PCC copy after detach.

[PCC\_DETACH\_FL\_KNOWN\_READWRITE](#PCC_DETACH_FL_KNOWN_READWRITE)

means that it is known that the file was once cached as PCC-RW.

[PCC\_DETACH\_FL\_KNOWN\_READONLY](#PCC_DETACH_FL_KNOWN_READONLY)

means that it is known that the file was once cached as PCC-RO.

[PCC\_DETACH\_FL\_CACHE\_REMOVED](#PCC_DETACH_FL_CACHE_REMOVED)

indicates that PCC cached copy is removed. It is used to tell the user space caller that the file is detached and the corresponding PCC copy is removed.

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_pcc\_detach\_fid\_fd()**, **llapi\_pcc\_detach\_fid()**, **llapi\_pcc\_detach\_fid\_str()**, and **llapi\_pcc\_detach\_file()** return 0 on success or a negative errno value on failure.

# [ERRORS](#ERRORS)

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

Insufficient memory to complete operation.

[**-EFAULT**](#EFAULT)

Memory region is not properly mapped.

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

One or more invalid arguments are given.

[**-EOPNOTSUPP**](#EOPNOTSUPP)

PCC state operation is not supported.

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

File does not reside on a Lustre filesystem.

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

*path* does not exist.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_pcc\_detach\_fid\_fd()**, **llapi\_pcc\_detach\_fid()**, **llapi\_pcc\_detach\_fid\_str()**, and **llapi\_pcc\_detach\_file()** are 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\_pcc\_attach**(3)](/man/enterprise-packages/lustre/llapi_pcc_attach.3), [**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2024-08-28 Lustre User API

---

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