LLAPI_PCC_STATE_GET(3)

NAME
llapi_pcc_state_get, llapi_pcc_state_get_fd, - get the current PCC state related to a file

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
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
    specifies the PCC mode for the given file, which is actual an lu_pcc_type data structure.

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

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

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

RETURN VALUES
llapi_pcc_state_get() and llapi_pcc_state_get_fd() return 0 on success or a negative errno value on failure.

ERRORS

-ENOMEM
    Insufficient memory to complete operation.

-EFAULT
    Memory region is not properly mapped.

-EINVAL
    One or more invalid arguments are given.

-EOPNOTSUPP
    PCC state operation is not supported.

AVAILABILITY
llapi_pcc_state_get() and llapi_pcc_state_get_fd() are part of the lustre(7) user application interface library since release 2.13.0

SEE ALSO
llapi_pcc_attach(3), lustreapi(7)