Commit 67db1034 authored by Jeff Layton's avatar Jeff Layton Committed by J. Bruce Fields

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: default avatarJeff Layton <jlayton@primarydata.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 49a068f8
...@@ -688,7 +688,7 @@ static void nfs4_put_deleg_lease(struct nfs4_file *fp) ...@@ -688,7 +688,7 @@ static void nfs4_put_deleg_lease(struct nfs4_file *fp)
struct file *filp = NULL; struct file *filp = NULL;
spin_lock(&fp->fi_lock); spin_lock(&fp->fi_lock);
if (fp->fi_deleg_file && atomic_dec_and_test(&fp->fi_delegees)) if (fp->fi_deleg_file && --fp->fi_delegees == 0)
swap(filp, fp->fi_deleg_file); swap(filp, fp->fi_deleg_file);
spin_unlock(&fp->fi_lock); spin_unlock(&fp->fi_lock);
...@@ -3855,12 +3855,12 @@ static int nfs4_setlease(struct nfs4_delegation *dp) ...@@ -3855,12 +3855,12 @@ static int nfs4_setlease(struct nfs4_delegation *dp)
/* Race breaker */ /* Race breaker */
if (fp->fi_deleg_file) { if (fp->fi_deleg_file) {
status = 0; status = 0;
atomic_inc(&fp->fi_delegees); ++fp->fi_delegees;
hash_delegation_locked(dp, fp); hash_delegation_locked(dp, fp);
goto out_unlock; goto out_unlock;
} }
fp->fi_deleg_file = filp; fp->fi_deleg_file = filp;
atomic_set(&fp->fi_delegees, 1); fp->fi_delegees = 1;
hash_delegation_locked(dp, fp); hash_delegation_locked(dp, fp);
spin_unlock(&fp->fi_lock); spin_unlock(&fp->fi_lock);
spin_unlock(&state_lock); spin_unlock(&state_lock);
...@@ -3901,7 +3901,7 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, ...@@ -3901,7 +3901,7 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
status = -EAGAIN; status = -EAGAIN;
goto out_unlock; goto out_unlock;
} }
atomic_inc(&fp->fi_delegees); ++fp->fi_delegees;
hash_delegation_locked(dp, fp); hash_delegation_locked(dp, fp);
status = 0; status = 0;
out_unlock: out_unlock:
......
...@@ -493,7 +493,7 @@ struct nfs4_file { ...@@ -493,7 +493,7 @@ struct nfs4_file {
atomic_t fi_access[2]; atomic_t fi_access[2];
u32 fi_share_deny; u32 fi_share_deny;
struct file *fi_deleg_file; struct file *fi_deleg_file;
atomic_t fi_delegees; int fi_delegees;
struct knfsd_fh fi_fhandle; struct knfsd_fh fi_fhandle;
bool fi_had_conflict; bool fi_had_conflict;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment