LLAPI\_PCC\_ATTACH(3) Lustre Library Functions LLAPI\_PCC\_ATTACH(3)

# [NAME](#NAME)

llapi\_pcc\_attach, llapi\_pcc\_attach\_fid, llapi\_pcc\_attach\_fid\_str - attach a file into PCC

# [SYNOPSIS](#SYNOPSIS)

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

```
int llapi_pcc_attach(const char *path, __u32 id,
                     enum lu_pcc_type type);
```

```
int llapi_pcc_attach_fid(const char *mntpath, const struct lu_fid *fid,
                         __u32 id, enum lu_pcc_type type);
```

```
int llapi_pcc_attach_fid_str(const char *mntpath, const char *fidstr,
                             __u32 id, enum lu_pcc_type type);
```

# [DESCRIPTION](#DESCRIPTION)

The function **llapi\_pcc\_attach()**, **llapi\_pcc\_attach\_fid()** and **llapi\_pcc\_attach\_fid\_str()** tries to attach the file referenced by *path*, *fid*, or *fidstr* into PCC backend. PCC provides a group of local caches and works in two modes: RW-PCC enables a read-write cache on the local SSDs of a single client; RO-PCC provides a read-only cache on the local SSDs of multiple clients. For RW-PCC, the argument *id* is the archive ID of the copytool agent running on this client. By default, RO-PCC attach ID is setting same with RW-PCC attach ID for a PCC backend if it is also used as read-only caching. The attach mode is specified by *type* argument, which is a **enum lu\_pcc\_type** data structure, which contains the following values:

```
	LU_PCC_NONE
	LU_PCC_READWRITE
	LU_PCC_READONLY
```

[LU\_PCC\_NONE](#LU_PCC_NONE)

means that the file is not cached on PCC.

[LU\_PCC\_READWRITE](#LU_PCC_READWRITE)

means RW-PCC mode.

[LU\_PCC\_READONLY](#LU_PCC_READONLY)

means RO-PCC mode.

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_pcc\_attach()** 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 attach operation is not supported.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_pcc\_attach()**, **llapi\_pcc\_attach\_fid()** and **llapi\_pcc\_attach\_fid\_str()** 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)

[**lustreapi**(7)](/man/enterprise-packages/lustre/lustreapi.7)

2024-08-28 Lustre User API

---

Document: llapi_pcc_attach_fid(3) from lustre 2.17.60-r0 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
