summaryrefslogtreecommitdiffstats
path: root/rpc/xdr/src/msg-nfs3.c
diff options
context:
space:
mode:
authorRajesh Amaravathi <rajesh@redhat.com>2012-04-12 14:49:44 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-17 02:12:49 -0700
commitcbcf82aa58058fe05dbd9a8d8879ca0364e5df95 (patch)
tree83c7dc8da592fb0442d5626eac6779c813d61655 /rpc/xdr/src/msg-nfs3.c
parentd8ede99e6f429d3a63b794c495f99fc8f76e9651 (diff)
nfs/nlm: procedures for PC clients
* This change introduces four NLMv4 procedures: NM_LOCK, SHARE, UNSHARE and FREE_ALL. These are used by PC clients (windows/dos) to control access to files. 1. NM_LOCK: this lock is not monitored by statd. 2. SHARE: A share reservation is a lock on the whole file that is taken whenever a file is opened on windows clients. This has ACCESS (N, R, W, RW) and DENY MODE (N, R, W, RW). ACCESS: mode of access requested by the client; DENY MODE: what the requesting client wants to deny other clients. 3. UNSHARE: remove a share reservation obtained by SHARE. Called while closing a file. 4. FREE_ALL: remove all share reservations and locks, both monitored and unmonitored, of the calling client. * lock and nm_lock use a common function with only a flag conveying whether or not to monitor a lock. * NOTES: 1. SHARE reservations are not STACK_WIND'd to subsequent xlators. These are maintained in-memory in the nfs xlator. 2. Consequently, for SHARE reservations to work effectively, all PC clients *must* mount from the same gNfs server. Not doing so will result in different servers maintaining separate SHARE reservations which will not be enforced for obvious reasons. Change-Id: Id4f22670a94ed58691a6a7f4c80aa8c11421a277 BUG: 800287 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/3212 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishna Srinivas <krishna@gluster.com>
Diffstat (limited to 'rpc/xdr/src/msg-nfs3.c')
-rw-r--r--rpc/xdr/src/msg-nfs3.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/rpc/xdr/src/msg-nfs3.c b/rpc/xdr/src/msg-nfs3.c
index f800b3128..8078f23f0 100644
--- a/rpc/xdr/src/msg-nfs3.c
+++ b/rpc/xdr/src/msg-nfs3.c
@@ -517,6 +517,20 @@ xdr_to_nlm4_unlockargs (struct iovec inmsg, nlm4_unlockargs *args)
}
ssize_t
+xdr_to_nlm4_shareargs (struct iovec inmsg, nlm4_shareargs *args)
+{
+ return xdr_to_generic (inmsg, (void*)args,
+ (xdrproc_t)xdr_nlm4_shareargs);
+}
+
+ssize_t
+xdr_serialize_nlm4_shareres (struct iovec outmsg, nlm4_shareres *res)
+{
+ return xdr_serialize_generic (outmsg, (void *)res,
+ (xdrproc_t)xdr_nlm4_shareres);
+}
+
+ssize_t
xdr_serialize_nlm4_testargs (struct iovec outmsg, nlm4_testargs *args)
{
return xdr_serialize_generic (outmsg, (void*)args,
@@ -530,3 +544,9 @@ xdr_to_nlm4_res (struct iovec inmsg, nlm4_res *args)
(xdrproc_t)xdr_nlm4_res);
}
+ssize_t
+xdr_to_nlm4_freeallargs (struct iovec inmsg, nlm4_freeallargs *args)
+{
+ return xdr_to_generic (inmsg, (void*)args,
+ (xdrproc_t)xdr_nlm4_freeallargs);
+}