Whamcloud - gitweb
LU-10966 utils: Fix `lfs check` documentation and arguments
[fs/lustre-release.git] / lustre / doc / llapi_path2parent.3
1 .TH llapi_path2parent 3 "2014 Oct 13" "Lustre User API"
2 .SH NAME
3 llapi_path2parent, llapi_fd2parent \- Retrieve <parent FID>/name(s) for an entry
4 in Lustre.
5 .SH SYNOPSIS
6 .nf
7 .B #include <lustre/lustreapi.h>
8 .PP
9 .BI "int llapi_path2parent(const char *" path ", unsigned int " linkno ","
10 .BI "                      struct lu_fid *" parent_fid ", char *" name ","
11 .BI "                      size_t " name_size );
12
13 .BI "int llapi_fd2parent(int " fd ", unsigned int " linkno ","
14 .BI "                    struct lu_fid *" parent_fid ", char *" name ","
15 .BI "                    size_t " name_size );
16 .sp
17 .fi
18 .SH DESCRIPTION
19 .PP
20 .BR llapi_path2parent()
21 for link number
22 .I linkno
23 stores the FID of the parent directory into
24 .I parent_fid
25 and the zero-terminated name of the entry into the buffer
26 .I name
27 which is expected to be of size
28 .IR name_size .
29
30 The function
31 .B llapi_fd2parent()
32 behaves similarly except that it operates on an open file descriptor
33 instead of a path.
34 .sp
35 .SH RETURN VALUES
36 .LP
37 .B llapi_path2fid()
38 and
39 .B llapi_fd2fid()
40 return 0 on success or a negative errno value on failure.
41 .SH ERRORS
42 .TP 15
43 .SM -ENODATA
44 linkno has reached the link count.
45 .TP
46 .SM -ENOTTY
47 .I path
48 does not reside on a Lustre filesystem.
49 .TP
50 .SM -ENOENT
51 .I path
52 does not exist.
53 .TP
54 .SM -EINVAL
55 An invalid argument was specified.
56 .TP
57 .SM -EOVERFLOW
58 The given buffer was too small.
59 .TP
60 .SM -EPERM
61 The file cannot be open by user or CAP_DAC_READ_SEARCH is not granted.
62 .SH "SEE ALSO"
63 .BR lustreapi (7)