aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorBenny Halevy <bhalevy@panasas.com>2009-04-01 09:22:52 -0400
committerBenny Halevy <bhalevy@panasas.com>2009-06-17 15:43:45 -0400
commit34dc1ad752ad3f55b2a6e6cd8cfcf3504682fec7 (patch)
tree8816d7038c09eae46e2da51561f2e80cc91063e0 /fs/nfs
parent78722e9c9208a312695178f5331511badd190598 (diff)
nfs41: increment_{open,lock}_seqid
Unlike minorversion0, in nfsv4.1 the open and lock seqids need not be incremented by the client and should always be set to zero. This is implemented using a new nfs_rpc_ops methods - increment_open_seqid and increment_lock_seqid Signed-off-by: Rahul Iyer <iyer@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> [nfs41: check for session not minorversion] Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4proc.c2
-rw-r--r--fs/nfs/nfs4state.c12
2 files changed, 9 insertions, 5 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 31ce758d53d5..f1f087b483ce 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1808,6 +1808,8 @@ int nfs4_do_close(struct path *path, struct nfs4_state *state, int wait)
1808 calldata->state = state; 1808 calldata->state = state;
1809 calldata->arg.fh = NFS_FH(state->inode); 1809 calldata->arg.fh = NFS_FH(state->inode);
1810 calldata->arg.stateid = &state->open_stateid; 1810 calldata->arg.stateid = &state->open_stateid;
1811 if (nfs4_has_session(server->nfs_client))
1812 memset(calldata->arg.stateid->data, 0, 4); /* clear seqid */
1811 /* Serialization for the sequence id */ 1813 /* Serialization for the sequence id */
1812 calldata->arg.seqid = nfs_alloc_seqid(&state->owner->so_seqid); 1814 calldata->arg.seqid = nfs_alloc_seqid(&state->owner->so_seqid);
1813 if (calldata->arg.seqid == NULL) 1815 if (calldata->arg.seqid == NULL)
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index 2cc0aca96eb2..2cfca9929c9a 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -742,12 +742,14 @@ static void nfs_increment_seqid(int status, struct nfs_seqid *seqid)
742 742
743void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid) 743void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid)
744{ 744{
745 if (status == -NFS4ERR_BAD_SEQID) { 745 struct nfs4_state_owner *sp = container_of(seqid->sequence,
746 struct nfs4_state_owner *sp = container_of(seqid->sequence, 746 struct nfs4_state_owner, so_seqid);
747 struct nfs4_state_owner, so_seqid); 747 struct nfs_server *server = sp->so_server;
748
749 if (status == -NFS4ERR_BAD_SEQID)
748 nfs4_drop_state_owner(sp); 750 nfs4_drop_state_owner(sp);
749 } 751 if (!nfs4_has_session(server->nfs_client))
750 nfs_increment_seqid(status, seqid); 752 nfs_increment_seqid(status, seqid);
751} 753}
752 754
753/* 755/*