diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-12-23 15:21:52 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-12-23 15:21:52 -0500 |
commit | b7391f44f26b17ad25c7183a3d6ad50f0a9305ff (patch) | |
tree | 8e09a5714587a8bde2a805819501d10bae4787b7 /fs/nfs/nfs4proc.c | |
parent | 6411bd4a471893ab2af103d96253ba97c92d4777 (diff) |
NFSv4: Return unreferenced delegations more promptly
If the client is not using a delegation, the right thing to do is to return
it as soon as possible. This helps reduce the amount of state the server
has to track, as well as reducing the potential for conflicts with other
clients.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 2a347d47e38c..fc0c9d255cf7 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -421,6 +421,7 @@ static int can_open_delegated(struct nfs_delegation *delegation, mode_t open_fla | |||
421 | return 0; | 421 | return 0; |
422 | if (test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags)) | 422 | if (test_bit(NFS_DELEGATION_NEED_RECLAIM, &delegation->flags)) |
423 | return 0; | 423 | return 0; |
424 | nfs_mark_delegation_referenced(delegation); | ||
424 | return 1; | 425 | return 1; |
425 | } | 426 | } |
426 | 427 | ||
@@ -505,6 +506,7 @@ static int update_open_stateid(struct nfs4_state *state, nfs4_stateid *open_stat | |||
505 | else if (memcmp(deleg_cur->stateid.data, delegation->data, NFS4_STATEID_SIZE) != 0) | 506 | else if (memcmp(deleg_cur->stateid.data, delegation->data, NFS4_STATEID_SIZE) != 0) |
506 | goto no_delegation_unlock; | 507 | goto no_delegation_unlock; |
507 | 508 | ||
509 | nfs_mark_delegation_referenced(deleg_cur); | ||
508 | __update_open_stateid(state, open_stateid, &deleg_cur->stateid, open_flags); | 510 | __update_open_stateid(state, open_stateid, &deleg_cur->stateid, open_flags); |
509 | ret = 1; | 511 | ret = 1; |
510 | no_delegation_unlock: | 512 | no_delegation_unlock: |