diff options
author | J. Bruce Fields <bfields@redhat.com> | 2010-07-30 11:33:32 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-07-30 12:54:54 -0400 |
commit | 039a87ca536a85bc169ce092e44bd57adfa1f563 (patch) | |
tree | 015ddd79fb489241b0171ce3c863353ae6c03522 /fs/nfsd/vfs.c | |
parent | 69049961014992f50b10d6c3cd3cd172d4aae5ac (diff) |
nfsd: minor nfsd read api cleanup
Christoph points that the NFSv2/v3 callers know which case they want
here, so we may as well just call the file=NULL case directly instead of
making this conditional.
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 3458a8f596f1..1709138affb1 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1065,7 +1065,12 @@ out: | |||
1065 | return err; | 1065 | return err; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | static __be32 nfsd_open_read(struct svc_rqst *rqstp, struct svc_fh *fhp, | 1068 | /* |
1069 | * Read data from a file. count must contain the requested read count | ||
1070 | * on entry. On return, *count contains the number of bytes actually read. | ||
1071 | * N.B. After this call fhp needs an fh_put | ||
1072 | */ | ||
1073 | __be32 nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, | ||
1069 | loff_t offset, struct kvec *vec, int vlen, unsigned long *count) | 1074 | loff_t offset, struct kvec *vec, int vlen, unsigned long *count) |
1070 | { | 1075 | { |
1071 | struct file *file; | 1076 | struct file *file; |
@@ -1101,13 +1106,9 @@ static __be32 nfsd_open_read(struct svc_rqst *rqstp, struct svc_fh *fhp, | |||
1101 | return err; | 1106 | return err; |
1102 | } | 1107 | } |
1103 | 1108 | ||
1104 | /* | 1109 | /* As above, but use the provided file descriptor. */ |
1105 | * Read data from a file. count must contain the requested read count | ||
1106 | * on entry. On return, *count contains the number of bytes actually read. | ||
1107 | * N.B. After this call fhp needs an fh_put | ||
1108 | */ | ||
1109 | __be32 | 1110 | __be32 |
1110 | nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, | 1111 | nfsd_read_file(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, |
1111 | loff_t offset, struct kvec *vec, int vlen, | 1112 | loff_t offset, struct kvec *vec, int vlen, |
1112 | unsigned long *count) | 1113 | unsigned long *count) |
1113 | { | 1114 | { |
@@ -1119,8 +1120,8 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, | |||
1119 | if (err) | 1120 | if (err) |
1120 | goto out; | 1121 | goto out; |
1121 | err = nfsd_vfs_read(rqstp, fhp, file, offset, vec, vlen, count); | 1122 | err = nfsd_vfs_read(rqstp, fhp, file, offset, vec, vlen, count); |
1122 | } else | 1123 | } else /* Note file may still be NULL in NFSv4 special stateid case: */ |
1123 | err = nfsd_open_read(rqstp, fhp, offset, vec, vlen, count); | 1124 | err = nfsd_read(rqstp, fhp, offset, vec, vlen, count); |
1124 | out: | 1125 | out: |
1125 | return err; | 1126 | return err; |
1126 | } | 1127 | } |