Whamcloud - gitweb
New tag 2.15.63
[fs/lustre-release.git] / lustre / doc / llapi_fid_to_handle.3
1 .TH llapi_fid_to_handle 3 "2022-11-08" "Lustre User API"
2 .SH NAME
3 llapi_fid_to_handle \- allocate an NFS handle for File Identifier
4 .SH SYNOPSIS
5 .nf
6 .B #include <lustre/lustreapi.h>
7 .PP
8 .BI "int llapi_fid_to_handle(struct file_handle **" handle ", struct lu_fid *" fid ");"
9 .fi
10 .SH DESCRIPTION
11 .PP
12 .BR llapi_fid_to_handle()
13 allocates an NFS file
14 .I handle
15 for the File Identifier given by
16 .I fid
17 for later use by
18 .BR open_by_handle_at (2).
19 This is similar to the
20 .BR name_to_handle_at (2)
21 function, and is useful for Lustre-specific tools and interfaces.  While the
22 .BR llapi_fid_to_handle (3)
23 function does not requre root access itself, the
24 .BR open_by_handle_at (2)
25 function
26 .B does
27 require root access since this bypasses all pathname-derived file access
28 permissions.
29 The memory allocated for
30 .I handle
31 and returned to the caller must be freed with
32 .IR free (2).
33 .SH RETURN VALUES
34 .LP
35 returns 0 on success or a negative errno on failure.
36 .SH ERRORS
37 .TP 15
38 .SM -ENOMEM
39 No memory was available for allocating
40 .IR handle .
41 .SH SEE ALSO
42 .BR free (3),
43 .BR llapi_fid_parse (3),
44 .BR llapi_fid2path (3),
45 .BR llapi_path2fid (3),
46 .BR lustreapi (7),
47 .BR name_to_handle (2)
48 .BR open_by_handle_at (2)