Whamcloud - gitweb
LU-17867 ko2iblnd: gcc bug work around
[fs/lustre-release.git] / lustre / doc / llapi_rmfid.3
1 .TH llapi_rmfid 3 "2014 Oct 13" "Lustre User API"
2 .SH NAME
3 llapi_rmfid \- Remove files by their FIDs in Lustre.
4 .SH SYNOPSIS
5 .nf
6 .B #include <lustre/lustreapi.h>
7 .PP
8 .BI "int llapi_rmfid(const char *" path ", struct fid_array *" fa ");
9 .BI "int llapi_rmfid_at(int " fd ", struct fid_array *" fa ");
10
11 .sp
12 .fi
13 .SH DESCRIPTION
14 .PP
15 .BR llapi_rmfid()
16 tries to remove
17 .I fa->fa_nr
18 Lustre files by FIDs stored in
19 .I fa->fa_fids
20 All file's hardlinks are subject to removal. This functionality is available
21 only for root or regular users on filesystems mounted with
22 .I user_fid2path
23 mount option to delete files that they own and are in a directory in which
24 they have write permission.
25
26 .BR llapi_rmfid_at()
27 Is similar to
28 .I llapi_rmfid.
29 It tries to remove Lustre files by FIDs stored in
30 .I fa->fa_fids
31 where path or device is pointed by an already verifed
32 .I fd.
33
34 .SH RETURN VALUES
35 .LP
36 .B llapi_rmfid()
37 and
38 .B llapi_rmfid_at()
39 return 0 on success or a negative errno value on failure. Result for each file
40 is stored in the corresponding
41 .I fa->fa_fid[N].f_ver
42 .SH ERRORS
43 .TP 15
44 .TP
45 .SM -ENOENT
46 .I file
47 does not exist.
48 .TP
49 .SM -EBUSY
50 file is open and can't be removed
51 .TP
52 .SM -EPERM
53 The file cannot be open by user or CAP_DAC_READ_SEARCH is not granted.
54 .TP
55 .SM -EINVAL
56 Invalid FID is passed
57 .TP
58 .SM -ENOMEM
59 Not enough memory to process the request
60 .TP
61 .SM -ENOTTY
62 .I file
63 may not point to a Lustre filesystem mountpoint
64 .SH "SEE ALSO"
65 .BR lustreapi (7)
66 .BR llapi_rmfid_at (3)