Skip to content

Commit f4d84c5

Browse files
committed
NFSD: Clean up nfsd_open_verified()
Its only caller always passes S_IFREG as the @type parameter. As an additional clean-up, add a kerneldoc comment. Signed-off-by: Chuck Lever <[email protected]>
1 parent 1c388f2 commit f4d84c5

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

fs/nfsd/filecache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,8 +995,8 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
995995

996996
nf->nf_mark = nfsd_file_mark_find_or_create(nf);
997997
if (nf->nf_mark)
998-
status = nfsd_open_verified(rqstp, fhp, S_IFREG,
999-
may_flags, &nf->nf_file);
998+
status = nfsd_open_verified(rqstp, fhp, may_flags,
999+
&nf->nf_file);
10001000
else
10011001
status = nfserr_jukebox;
10021002
/*

fs/nfsd/vfs.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,14 +827,23 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
827827
return err;
828828
}
829829

830+
/**
831+
* nfsd_open_verified - Open a regular file for the filecache
832+
* @rqstp: RPC request
833+
* @fhp: NFS filehandle of the file to open
834+
* @may_flags: internal permission flags
835+
* @filp: OUT: open "struct file *"
836+
*
837+
* Returns an nfsstat value in network byte order.
838+
*/
830839
__be32
831-
nfsd_open_verified(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type,
832-
int may_flags, struct file **filp)
840+
nfsd_open_verified(struct svc_rqst *rqstp, struct svc_fh *fhp, int may_flags,
841+
struct file **filp)
833842
{
834843
__be32 err;
835844

836845
validate_process_creds();
837-
err = __nfsd_open(rqstp, fhp, type, may_flags, filp);
846+
err = __nfsd_open(rqstp, fhp, S_IFREG, may_flags, filp);
838847
validate_process_creds();
839848
return err;
840849
}

fs/nfsd/vfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ __be32 nfsd_setxattr(struct svc_rqst *rqstp, struct svc_fh *fhp,
8686
int nfsd_open_break_lease(struct inode *, int);
8787
__be32 nfsd_open(struct svc_rqst *, struct svc_fh *, umode_t,
8888
int, struct file **);
89-
__be32 nfsd_open_verified(struct svc_rqst *, struct svc_fh *, umode_t,
89+
__be32 nfsd_open_verified(struct svc_rqst *, struct svc_fh *,
9090
int, struct file **);
9191
__be32 nfsd_splice_read(struct svc_rqst *rqstp, struct svc_fh *fhp,
9292
struct file *file, loff_t offset,

0 commit comments

Comments
 (0)