aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-04-28 09:41:16 -0400
committerJ. Bruce Fields <bfields@redhat.com>2015-05-04 12:02:43 -0400
commitfd891454609ec036dc23e34536e45d655b4ca4db (patch)
treee82131c7df48cc7df01278ac13131f0efa8c656b
parent4bd9e9b77fc6787c45b8bb439f6511aa3478606c (diff)
nfsd: remove nfsd_close
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4state.c2
-rw-r--r--fs/nfsd/vfs.c19
-rw-r--r--fs/nfsd/vfs.h1
3 files changed, 6 insertions, 16 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 039f9c8a95e8..86f5c273c9ec 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5505,7 +5505,7 @@ static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct
5505 __be32 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file); 5505 __be32 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file);
5506 if (!err) { 5506 if (!err) {
5507 err = nfserrno(vfs_test_lock(file, lock)); 5507 err = nfserrno(vfs_test_lock(file, lock));
5508 nfsd_close(file); 5508 fput(file);
5509 } 5509 }
5510 return err; 5510 return err;
5511} 5511}
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 84d770be056e..a30e79900086 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -744,7 +744,7 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
744 744
745 host_err = ima_file_check(file, may_flags, 0); 745 host_err = ima_file_check(file, may_flags, 0);
746 if (host_err) { 746 if (host_err) {
747 nfsd_close(file); 747 fput(file);
748 goto out_nfserr; 748 goto out_nfserr;
749 } 749 }
750 750
@@ -762,15 +762,6 @@ out:
762} 762}
763 763
764/* 764/*
765 * Close a file.
766 */
767void
768nfsd_close(struct file *filp)
769{
770 fput(filp);
771}
772
773/*
774 * Obtain the readahead parameters for the file 765 * Obtain the readahead parameters for the file
775 * specified by (dev, ino). 766 * specified by (dev, ino).
776 */ 767 */
@@ -1040,7 +1031,7 @@ void nfsd_put_tmp_read_open(struct file *file, struct raparms *ra)
1040 ra->p_count--; 1031 ra->p_count--;
1041 spin_unlock(&rab->pb_lock); 1032 spin_unlock(&rab->pb_lock);
1042 } 1033 }
1043 nfsd_close(file); 1034 fput(file);
1044} 1035}
1045 1036
1046/* 1037/*
@@ -1093,7 +1084,7 @@ nfsd_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
1093 if (cnt) 1084 if (cnt)
1094 err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen, 1085 err = nfsd_vfs_write(rqstp, fhp, file, offset, vec, vlen,
1095 cnt, stablep); 1086 cnt, stablep);
1096 nfsd_close(file); 1087 fput(file);
1097 } 1088 }
1098out: 1089out:
1099 return err; 1090 return err;
@@ -1138,7 +1129,7 @@ nfsd_commit(struct svc_rqst *rqstp, struct svc_fh *fhp,
1138 err = nfserr_notsupp; 1129 err = nfserr_notsupp;
1139 } 1130 }
1140 1131
1141 nfsd_close(file); 1132 fput(file);
1142out: 1133out:
1143 return err; 1134 return err;
1144} 1135}
@@ -1977,7 +1968,7 @@ nfsd_readdir(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t *offsetp,
1977 if (err == nfserr_eof || err == nfserr_toosmall) 1968 if (err == nfserr_eof || err == nfserr_toosmall)
1978 err = nfs_ok; /* can still be found in ->err */ 1969 err = nfs_ok; /* can still be found in ->err */
1979out_close: 1970out_close:
1980 nfsd_close(file); 1971 fput(file);
1981out: 1972out:
1982 return err; 1973 return err;
1983} 1974}
diff --git a/fs/nfsd/vfs.h b/fs/nfsd/vfs.h
index 2050cb016998..17a5e0db6a77 100644
--- a/fs/nfsd/vfs.h
+++ b/fs/nfsd/vfs.h
@@ -71,7 +71,6 @@ __be32 nfsd_commit(struct svc_rqst *, struct svc_fh *,
71#endif /* CONFIG_NFSD_V3 */ 71#endif /* CONFIG_NFSD_V3 */
72__be32 nfsd_open(struct svc_rqst *, struct svc_fh *, umode_t, 72__be32 nfsd_open(struct svc_rqst *, struct svc_fh *, umode_t,
73 int, struct file **); 73 int, struct file **);
74void nfsd_close(struct file *);
75struct raparms; 74struct raparms;
76__be32 nfsd_get_tmp_read_open(struct svc_rqst *, struct svc_fh *, 75__be32 nfsd_get_tmp_read_open(struct svc_rqst *, struct svc_fh *,
77 struct file **, struct raparms **); 76 struct file **, struct raparms **);