Whamcloud - gitweb
LU-17705 ptlrpc: replace synchronize_rcu() with rcu_barrier()
[fs/lustre-release.git] / lustre / doc / llapi_group_lock.3
1 .TH llapi_group_lock 3 "2014 Oct 03" "Lustre User API"
2 .SH NAME
3 llapi_group_lock, llapi_group_unlock, llapi_group_lock64, llapi_group_unlock64 \- get and put a Lustre group lock.
4 .SH SYNOPSIS
5 .nf
6 .B #include <lustre/lustreapi.h>
7 .PP
8 .BI "int llapi_group_lock(int "fd ", int "gid );
9 .BI "int llapi_group_lock64(int "fd ", __u64 "gid );
10
11 .BI "int llapi_group_unlock(int "fd ", int "gid );
12 .BI "int llapi_group_unlock64(int "fd ", __u64 "gid );
13 .fi
14 .SH DESCRIPTION
15 .PP
16 The functions
17 .BR llapi_group_lock()
18 and
19 .BR llapi_group_lock64()
20 take a group lock on the file descriptor
21 .I fd
22 with group identifier
23 .IR gid
24 (int or __u64 type) .
25
26 The functions
27 .BR llapi_group_unlock()
28 and
29 .BR llapi_group_unlock64()
30 release a group lock identified by group identifier
31 .I gid
32 (int or __u64 type) on the file descriptor
33 .IR fd .
34
35 The group lock is a whole file lock that blocks concurrent I/O originating from descriptors that have not been locked. Multiple processes can acquire a lock by specifying the same group identifier.
36
37 .SH RETURN VALUES
38 .LP
39 .B llapi_group_lock(\|),
40 .B llapi_group_lock64(\|),
41 .B llapi_group_unlock(\|)
42 and
43 .B llapi_group_unlock64(\|)
44 return 0 on success or a negative errno value on failure.
45 .SH ERRORS
46 .TP 15
47 .SM -EBADF
48 .I fd
49 is not a valid file descriptor.
50 .TP
51 .SM -ENOTTY
52 .I fd
53 does not describe an object suitable for this request.
54 .TP
55 .SM -EINVAL
56 .I fd
57 is already group locked with a different group identifier.
58 .TP
59 .SH "SEE ALSO"
60 .BR lustreapi (7)