Whamcloud - gitweb
LU-12616 obclass: fix MDS start/stop race
[fs/lustre-release.git] / lustre / doc / llapi_pcc_attach.3
1 .TH llapi_pcc_attach 3 "2019 April 20" "Lustre User API"
2 .SH NAME
3 llapi_pcc_attach, llapi_pcc_attach_fid, llapi_pcc_attach_fid_str \- attach a file into PCC
4 .SH SYNOPSIS
5 .nf
6 .B #include <lustre/lustreapi.h>
7 .PP
8 .BI "int llapi_pcc_attach(const char *" path ", __u32 " id ,
9 .BI "                     enum lu_pcc_type " type ");"
10 .PP
11 .BI "int llapi_pcc_attach_fid(const char *" mntpath ", const struct lu_fid *" fid ,
12 .BI "                         __u32 " id ", enum lu_pcc_type " type ");"
13 .PP
14 .BI "int llapi_pcc_attach_fid_str(const char *" mntpath ", const char *" fidstr ,
15 .BI "                             __u32 " id ", enum lu_pcc_type " type ");"
16 .fi
17 .SH DESCRIPTION
18 .PP
19 The function
20 .BR llapi_pcc_attach() ,
21 .BR llapi_pcc_attach_fid() ,
22 and
23 .BR llapi_pcc_attach_fid_str()
24 tries to attach the file referenced by
25 .IR path ,
26 .IR fid ,
27 or
28 .IR fidstr
29 into PCC backend. PCC provides a group of local caches and works in two modes:
30 RW-PCC enables a read-write cache on the local SSDs of a single client; RO-PCC
31 provides a read-only cache on the local SSDs of multiple clients. For RW-PCC,
32 the argument
33 .I id
34 is the archive ID of the copytool agent running on this client. By default,
35 RO-PCC attach ID is setting same with RW-PCC attach ID for a PCC backend if it
36 is also used as read-only caching. The attach mode is specified by
37 .I type
38 argument, which is a
39 .B enum lu_pcc_type
40 data structure, which contains the following values:
41 .nf
42 .LP
43         LU_PCC_NONE
44         LU_PCC_READWRITE
45         LU_PCC_READONLY
46 .fi
47 .TP
48 LU_PCC_NONE
49 menas that the file is not cached on PCC.
50 .TP
51 LU_PCC_READWRITE
52 means RW-PCC mode.
53 .TP
54 LU_PCC_READONLY
55 means RO-PCC mode.
56 .SH RETURN VALUES
57 .PP
58 .B llapi_pcc_attach()
59 return 0 on success or a negative errno value on failure.
60 .SH ERRORS
61 .TP 15
62 .SM -ENOMEM
63 Insufficient memory to complete operation.
64 .TP
65 .SM -EFAULT
66 Memory region is not properly mapped.
67 .TP
68 .SM -EINVAL
69 One or more invalid arguments are given.
70 .TP
71 .SM -EOPNOTSUPP
72 PCC attach operation is not supported.
73 .SH "SEE ALSO"
74 .BR lustreapi (7)