Commit 077f48d1 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] knfsd cleanups

nfsd_read() slightly cleaned up.
parent 4c93af34
...@@ -584,6 +584,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -584,6 +584,7 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
mm_segment_t oldfs; mm_segment_t oldfs;
int err; int err;
struct file file; struct file file;
struct inode *inode;
err = nfsd_open(rqstp, fhp, S_IFREG, MAY_READ, &file); err = nfsd_open(rqstp, fhp, S_IFREG, MAY_READ, &file);
if (err) if (err)
...@@ -591,14 +592,15 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset, ...@@ -591,14 +592,15 @@ nfsd_read(struct svc_rqst *rqstp, struct svc_fh *fhp, loff_t offset,
err = nfserr_perm; err = nfserr_perm;
if (!file.f_op->read) if (!file.f_op->read)
goto out_close; goto out_close;
inode = file.f_dentry->d_inode;
#ifdef MSNFS #ifdef MSNFS
if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
(!lock_may_read(file.f_dentry->d_inode, offset, *count))) (!lock_may_read(inode, offset, *count)))
goto out_close; goto out_close;
#endif #endif
/* Get readahead parameters */ /* Get readahead parameters */
ra = nfsd_get_raparms(fhp->fh_export->ex_dev, fhp->fh_dentry->d_inode->i_ino); ra = nfsd_get_raparms(inode->i_dev, inode->i_ino);
if (ra) { if (ra) {
file.f_reada = ra->p_reada; file.f_reada = ra->p_reada;
file.f_ramax = ra->p_ramax; file.f_ramax = ra->p_ramax;
......
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