diff options
author | Alexandros Batsakis <batsakis@netapp.com> | 2009-12-05 13:30:21 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-12-05 13:30:21 -0500 |
commit | 4882ef72cd9a5c006087ca94a228323018eac29f (patch) | |
tree | 4dba8abfbde3ca48b0012bf8d9abe8ec4260b061 /fs/nfs/nfs4proc.c | |
parent | d8cb1a7ce36d44602946f06af4267da304fb4011 (diff) |
nfs41: add support for the exclusive create flags
In v4.1 the client MUST/SHOULD use the EXCLUSIVE4_1 flag instead of
EXCLUSIVE4, and GUARDED when the server supports persistent sessions.
For now (and until we support suppattr_exclcreat), we don't send any
attributes with EXCLUSIVE4_1 relying in the subsequent SETATTR as in v4.0
Signed-off-by: Alexandros Batsakis <batsakis@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 637a6b476bd6..e07f6c7f5b97 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -726,9 +726,15 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path, | |||
726 | p->o_arg.bitmask = server->attr_bitmask; | 726 | p->o_arg.bitmask = server->attr_bitmask; |
727 | p->o_arg.claim = NFS4_OPEN_CLAIM_NULL; | 727 | p->o_arg.claim = NFS4_OPEN_CLAIM_NULL; |
728 | if (flags & O_EXCL) { | 728 | if (flags & O_EXCL) { |
729 | u32 *s = (u32 *) p->o_arg.u.verifier.data; | 729 | if (nfs4_has_persistent_session(server->nfs_client)) { |
730 | s[0] = jiffies; | 730 | /* GUARDED */ |
731 | s[1] = current->pid; | 731 | p->o_arg.u.attrs = &p->attrs; |
732 | memcpy(&p->attrs, attrs, sizeof(p->attrs)); | ||
733 | } else { /* EXCLUSIVE4_1 */ | ||
734 | u32 *s = (u32 *) p->o_arg.u.verifier.data; | ||
735 | s[0] = jiffies; | ||
736 | s[1] = current->pid; | ||
737 | } | ||
732 | } else if (flags & O_CREAT) { | 738 | } else if (flags & O_CREAT) { |
733 | p->o_arg.u.attrs = &p->attrs; | 739 | p->o_arg.u.attrs = &p->attrs; |
734 | memcpy(&p->attrs, attrs, sizeof(p->attrs)); | 740 | memcpy(&p->attrs, attrs, sizeof(p->attrs)); |