Commit:     a8754beedbdc56864bc5f8c9461929a9b328b899
Parent:     c7eb26678e59f16f4e84f1176d187cd21a27414d
Author:     Dave Hansen <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:31:15 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:43:05 2007 -0700

    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 <[EMAIL PROTECTED]>
    Acked-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 fs/nfsd/vfs.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 2a8d665..1d72f99 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -865,6 +865,15 @@ static int nfsd_direct_splice_actor(struct pipe_inode_info 
        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);
+       return 0;
 static __be32
 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)
@@ -877,11 +886,9 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, 
struct file *file,
        err = nfserr_perm;
        inode = file->f_path.dentry->d_inode;
-#ifdef MSNFS
-       if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
-               (!lock_may_read(inode, offset, *count)))
+       if (svc_msnfs(fhp) && !lock_may_read(inode, offset, *count))
                goto out;
        /* Get readahead parameters */
        ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to