LLAPI\_PCC\_STATE\_GET(3) Lustre Library Functions LLAPI\_PCC\_STATE\_GET(3)

# [NAME](#NAME)

llapi\_pcc\_state\_get, llapi\_pcc\_state\_get\_fd, - get the current PCC state related to a file

# [SYNOPSIS](#SYNOPSIS)

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

```
int llapi_pcc_state_get(const char *path, struct lu_pcc_state *state);
int llapi_pcc_state_get_fd(int fd, struct lu_pcc_state *state);
```

# [DESCRIPTION](#DESCRIPTION)

The functions **llapi\_pcc\_state\_get()** and **llapi\_pcc\_state\_get\_fd()** return the PCC state information for the file referenced by *path* or *fd*. Information is returned in the *state* argument which should be already allocated, which is a **lu\_pcc\_state** data structure, which contains the following fields:

```
struct lu_pcc_state {
	__u32	pccs_type; /* enum lu_pcc_type */
	__u32	pccs_open_count;
	__u32	pccs_flags; /* enum lu_pcc_state_flags */
	__u32	pccs_padding;
	char	pccs_path[PATH_MAX];
};
```

[*pccs\_type*](#pccs_type)

specifies the PCC mode for the given file, which is actual an **lu\_pcc\_type** data structure.

[*pccs\_open\_count*](#pccs_open_count)

indicates the opener count for the given file on the client.

[*pccs\_flags*](#pccs_flags)

is PCC flags for the given file, not used currently.

[*pccs\_path*](#pccs_path)

is the full path of the cached file on the PCC backend.

# [RETURN VALUES](#RETURN_VALUES)

**llapi\_pcc\_state\_get()** and **llapi\_pcc\_state\_get\_fd()** 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.

# [AVAILABILITY](#AVAILABILITY)

**llapi\_pcc\_state\_get()** and **llapi\_pcc\_state\_get\_fd()** 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_state_get(3) from lustre 2.17.59-r2 (Chainguard OS)
Source: https://github.com/lustre/lustre-release
