aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-12-13 09:11:40 -0500
committerJ. Bruce Fields <bfields@redhat.com>2015-01-07 14:05:35 -0500
commit67db10344816c74709271c30905bb83781e7050c (patch)
tree7f69fb33e8f0b6c2cdc775b8e6aecd04d426c44c /fs/nfsd/nfs4state.c
parent49a068f82a1d30eb585d7804b05948376be6cf9a (diff)
nfsd: fi_delegees doesn't need to be an atomic_t
fi_delegees is always handled under the fi_lock, so there's no need to use an atomic_t for this field. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index c06a1ba80d73..277f8b8529d6 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -688,7 +688,7 @@ static void nfs4_put_deleg_lease(struct nfs4_file *fp)
688 struct file *filp = NULL; 688 struct file *filp = NULL;
689 689
690 spin_lock(&fp->fi_lock); 690 spin_lock(&fp->fi_lock);
691 if (fp->fi_deleg_file && atomic_dec_and_test(&fp->fi_delegees)) 691 if (fp->fi_deleg_file && --fp->fi_delegees == 0)
692 swap(filp, fp->fi_deleg_file); 692 swap(filp, fp->fi_deleg_file);
693 spin_unlock(&fp->fi_lock); 693 spin_unlock(&fp->fi_lock);
694 694
@@ -3855,12 +3855,12 @@ static int nfs4_setlease(struct nfs4_delegation *dp)
3855 /* Race breaker */ 3855 /* Race breaker */
3856 if (fp->fi_deleg_file) { 3856 if (fp->fi_deleg_file) {
3857 status = 0; 3857 status = 0;
3858 atomic_inc(&fp->fi_delegees); 3858 ++fp->fi_delegees;
3859 hash_delegation_locked(dp, fp); 3859 hash_delegation_locked(dp, fp);
3860 goto out_unlock; 3860 goto out_unlock;
3861 } 3861 }
3862 fp->fi_deleg_file = filp; 3862 fp->fi_deleg_file = filp;
3863 atomic_set(&fp->fi_delegees, 1); 3863 fp->fi_delegees = 1;
3864 hash_delegation_locked(dp, fp); 3864 hash_delegation_locked(dp, fp);
3865 spin_unlock(&fp->fi_lock); 3865 spin_unlock(&fp->fi_lock);
3866 spin_unlock(&state_lock); 3866 spin_unlock(&state_lock);
@@ -3901,7 +3901,7 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
3901 status = -EAGAIN; 3901 status = -EAGAIN;
3902 goto out_unlock; 3902 goto out_unlock;
3903 } 3903 }
3904 atomic_inc(&fp->fi_delegees); 3904 ++fp->fi_delegees;
3905 hash_delegation_locked(dp, fp); 3905 hash_delegation_locked(dp, fp);
3906 status = 0; 3906 status = 0;
3907out_unlock: 3907out_unlock: