aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-07-10 14:07:29 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-07-11 11:05:57 -0400
commit6d338b51eb6e37b4d6f1459c892f5ec7df0dad88 (patch)
tree5a5195516d9dc71eff45f7b25b0275c8eb1372e3
parent12659651721a1c291ec8e1976925985a2c1bfe7c (diff)
nfsd: remove nfs4_file_put_fd
...and replace it with a simple swap call. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4state.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index a19257f91f25..c02bad6d7e90 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -394,15 +394,6 @@ nfs4_file_get_access(struct nfs4_file *fp, u32 access)
394 return nfs_ok; 394 return nfs_ok;
395} 395}
396 396
397static struct file *nfs4_file_put_fd(struct nfs4_file *fp, int oflag)
398{
399 struct file *filp;
400
401 filp = fp->fi_fds[oflag];
402 fp->fi_fds[oflag] = NULL;
403 return filp;
404}
405
406static void __nfs4_file_put_access(struct nfs4_file *fp, int oflag) 397static void __nfs4_file_put_access(struct nfs4_file *fp, int oflag)
407{ 398{
408 might_lock(&fp->fi_lock); 399 might_lock(&fp->fi_lock);
@@ -411,9 +402,9 @@ static void __nfs4_file_put_access(struct nfs4_file *fp, int oflag)
411 struct file *f1 = NULL; 402 struct file *f1 = NULL;
412 struct file *f2 = NULL; 403 struct file *f2 = NULL;
413 404
414 f1 = nfs4_file_put_fd(fp, oflag); 405 swap(f1, fp->fi_fds[oflag]);
415 if (atomic_read(&fp->fi_access[1 - oflag]) == 0) 406 if (atomic_read(&fp->fi_access[1 - oflag]) == 0)
416 f2 = nfs4_file_put_fd(fp, O_RDWR); 407 swap(f2, fp->fi_fds[O_RDWR]);
417 spin_unlock(&fp->fi_lock); 408 spin_unlock(&fp->fi_lock);
418 if (f1) 409 if (f1)
419 fput(f1); 410 fput(f1);