mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 00:38:55 +00:00
r/o bind mounts: create cleanup helper svc_msnfs()
I'm going to be modifying nfsd_rename() shortly to support read-only bind mounts. This #ifdef is around the area I'm patching, and it starts to get really ugly if I just try to add my new code by itself. Using this little helper makes things a lot cleaner to use. Signed-off-by: Dave Hansen <haveblue@us.ibm.com> Acked-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c7eb26678e
commit
a8754beedb
@ -865,6 +865,15 @@ static int nfsd_direct_splice_actor(struct pipe_inode_info *pipe,
|
|||||||
return __splice_from_pipe(pipe, sd, nfsd_splice_actor);
|
return __splice_from_pipe(pipe, sd, nfsd_splice_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int svc_msnfs(struct svc_fh *ffhp)
|
||||||
|
{
|
||||||
|
#ifdef MSNFS
|
||||||
|
return (ffhp->fh_export->ex_flags & NFSEXP_MSNFS);
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static __be32
|
static __be32
|
||||||
nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
||||||
loff_t offset, struct kvec *vec, int vlen, unsigned long *count)
|
loff_t offset, struct kvec *vec, int vlen, unsigned long *count)
|
||||||
@ -877,11 +886,9 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
|
|||||||
|
|
||||||
err = nfserr_perm;
|
err = nfserr_perm;
|
||||||
inode = file->f_path.dentry->d_inode;
|
inode = file->f_path.dentry->d_inode;
|
||||||
#ifdef MSNFS
|
|
||||||
if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
|
if (svc_msnfs(fhp) && !lock_may_read(inode, offset, *count))
|
||||||
(!lock_may_read(inode, offset, *count)))
|
|
||||||
goto out;
|
goto out;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Get readahead parameters */
|
/* Get readahead parameters */
|
||||||
ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino);
|
ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user