Whamcloud - gitweb
LU-12624 lod: alloc dir stripes by QoS
[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 NUL-terminated name of the entry into the buffer
26 .I name
27 which is expected to be of size
28 .IR name_size .
29 If
30 .I linkno
31 should be initialized to
32 .B -1
33 when starting to iterate over all links of a file.  The function
34 .B llapi_fd2parent()
35 behaves similarly except that it operates on an open file descriptor
36 instead of a path.
37 .sp
38 .SH RETURN VALUES
39 .LP
40 0 is returned on success or a negative errno value on failure.
41 .SH ERRORS
42 .TP 15
43 .SM -ENODATA
44 linkno has reached the total link count of the file.
45 .TP
46 .SM -ENOTTY
47 .I path
48 or
49 .I fd
50 does not reside on a Lustre filesystem.
51 .TP
52 .SM -ENOENT
53 .I path
54 does not exist.
55 .TP
56 .SM -EINVAL
57 An invalid argument was specified.
58 .TP
59 .SM -EOVERFLOW
60 The given buffer was too small to hold the pathname.
61 .TP
62 .SM -EPERM
63 The file cannot be open by user or CAP_DAC_READ_SEARCH is not granted.
64 .SH "SEE ALSO"
65 .BR lfs-path2fid (1),
66 .BR llapi_fid2path (3),
67 .BR llapi_path2fid (3),
68 .BR lustreapi (7)