diff options
author | Rajesh Amaravathi <rajesh@redhat.com> | 2012-04-12 14:49:44 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-05-18 05:53:10 -0700 |
commit | 7914df6c6ab6d7d3905b26c1dbc5ac07d79ef10f (patch) | |
tree | f7402ef4afe781cdc6409e0518618b17ae98a7cd /rpc/xdr/src/nlm4-xdr.h | |
parent | 27f4cc44140260516efa5a226b9f49b761b6b559 (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/3356
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'rpc/xdr/src/nlm4-xdr.h')
-rw-r--r-- | rpc/xdr/src/nlm4-xdr.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rpc/xdr/src/nlm4-xdr.h b/rpc/xdr/src/nlm4-xdr.h index fcc0e51b3c8..f9d6efd4d61 100644 --- a/rpc/xdr/src/nlm4-xdr.h +++ b/rpc/xdr/src/nlm4-xdr.h @@ -170,6 +170,13 @@ struct nlm4_shareres { }; typedef struct nlm4_shareres nlm4_shareres; +struct nlm4_freeallargs { + char *name; + u_int32_t state; +}; +typedef struct nlm4_freeallargs nlm4_freeallargs; + + #define NLM4_NULL 0 #define NLM4_TEST 1 #define NLM4_LOCK 2 @@ -216,6 +223,7 @@ extern bool_t xdr_nlm4_cancargs (XDR *, nlm4_cancargs*); extern bool_t xdr_nlm4_unlockargs (XDR *, nlm4_unlockargs*); extern bool_t xdr_nlm4_shareargs (XDR *, nlm4_shareargs*); extern bool_t xdr_nlm4_shareres (XDR *, nlm4_shareres*); +extern bool_t xdr_nlm4_freeallargs (XDR *, nlm4_freeallargs*); #else /* K&R C */ extern bool_t xdr_netobj (); @@ -235,6 +243,7 @@ extern bool_t xdr_nlm4_cancargs (); extern bool_t xdr_nlm4_unlockargs (); extern bool_t xdr_nlm4_shareargs (); extern bool_t xdr_nlm4_shareres (); +extern bool_t xdr_nlm4_freeallargs (); #endif /* K&R C */ |