Whamcloud - gitweb
LU-10092 llite: Add persistent cache on client
[fs/lustre-release.git] / lustre / doc / llapi_pcc_state_get.3
1 .TH llapi_pcc_state_get 3 "2019 April 20" "Lustre User API"
2 .SH NAME
3 llapi_pcc_state_get, llapi_pcc_state_get_fd, \- get the current PCC state
4 related to a file
5 .SH SYNOPSIS
6 .nf
7 .B #include <lustre/lustreapi.h>
8 .PP
9 .BI "int llapi_pcc_state_get(const char *" path ", struct lu_pcc_state *" state ");"
10 .PP
11 .BI "int llapi_pcc_state_get_fd(int " fd ", struct lu_pcc_state *" state ");"
12 .fi
13 .SH DESCRIPTION
14 .PP
15 The function
16 .BR llapi_pcc_state_get()
17 and
18 .BR llapi_pcc_state_get_fd()
19 returns the PCC state information for the file referenced by
20 .IR path
21 or
22 .IR fd .
23 Information is returned in the
24 .IR state
25 argument which should be already allocated, which is a
26 .B lu_pcc_state
27 data structure, which contains the following fields:
28 .nf
29 .LP
30 struct lu_pcc_state {
31         __u32   pccs_type; /* enum lu_pcc_type */
32         __u32   pccs_open_count;
33         __u32   pccs_flags; /* enum lu_pcc_state_flags */
34         __u32   pccs_padding;
35         char    pccs_path[PATH_MAX];
36 };
37 .fi
38 .TP
39 .I pccs_type
40 specifies the PCC mode for the given file, which is actual an
41 .B lu_pcc_type
42 data structure.
43 .TP
44 .I pccs_open_count
45 indicates the opener count for the given file on the client.
46 .TP
47 .I pccs_flags
48 is PCC flags for the given file,  not used currently.
49 .TP
50 .I pccs_path
51 is the full path of the cached file on the PCC backend.
52 .SH RETURN VALUES
53 .PP
54 .B llapi_pcc_state_get()
55 and
56 .B llapi_pcc_state_get_fd()
57 return 0 on success or a negative errno value on failure.
58 .SH ERRORS
59 .TP 15
60 .SM -ENOMEM
61 Insufficient memory to complete operation.
62 .TP
63 .SM -EFAULT
64 Memory region is not properly mapped.
65 .TP
66 .SM -EINVAL
67 One or more invalid arguments are given.
68 .TP
69 .SM -EOPNOTSUPP
70 PCC state operation is not supported.
71 .SH "SEE ALSO"
72 .BR llapi_pcc_attach (3),
73 .BR lustreapi (7)