Use struct path in struct svc_export
[pandora-kernel.git] / fs / nfsd / nfsproc.c
index ec983b7..6cfc96a 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/unistd.h>
 #include <linux/slab.h>
 
+#include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
 #include <linux/nfsd/cache.h>
@@ -40,7 +41,7 @@ static __be32
 nfsd_return_attrs(__be32 err, struct nfsd_attrstat *resp)
 {
        if (err) return err;
-       return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
+       return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt,
                                    resp->fh.fh_dentry,
                                    &resp->stat));
 }
@@ -48,7 +49,7 @@ static __be32
 nfsd_return_dirop(__be32 err, struct nfsd_diropres *resp)
 {
        if (err) return err;
-       return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
+       return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt,
                                    resp->fh.fh_dentry,
                                    &resp->stat));
 }
@@ -147,14 +148,14 @@ nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
         */
 
        if (NFSSVC_MAXBLKSIZE_V2 < argp->count) {
+               char buf[RPC_MAX_ADDRBUFLEN];
                printk(KERN_NOTICE
-                       "oversized read request from %u.%u.%u.%u:%d (%d bytes)\n",
-                               NIPQUAD(rqstp->rq_addr.sin_addr.s_addr),
-                               ntohs(rqstp->rq_addr.sin_port),
+                       "oversized read request from %s (%d bytes)\n",
+                               svc_print_addr(rqstp, buf, sizeof(buf)),
                                argp->count);
                argp->count = NFSSVC_MAXBLKSIZE_V2;
        }
-       svc_reserve(rqstp, (19<<2) + argp->count + 4);
+       svc_reserve_auth(rqstp, (19<<2) + argp->count + 4);
 
        resp->count = argp->count;
        nfserr = nfsd_read(rqstp, fh_copy(&resp->fh, &argp->fh), NULL,
@@ -163,7 +164,7 @@ nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
                                  &resp->count);
 
        if (nfserr) return nfserr;
-       return nfserrno(vfs_getattr(resp->fh.fh_export->ex_mnt,
+       return nfserrno(vfs_getattr(resp->fh.fh_export->ex_path.mnt,
                                    resp->fh.fh_dentry,
                                    &resp->stat));
 }
@@ -277,7 +278,8 @@ nfsd_proc_create(struct svc_rqst *rqstp, struct nfsd_createargs *argp,
                                         *   echo thing > device-special-file-or-pipe
                                         * by doing a CREATE with type==0
                                         */
-                                       nfserr = nfsd_permission(newfhp->fh_export,
+                                       nfserr = nfsd_permission(rqstp,
+                                                                newfhp->fh_export,
                                                                 newfhp->fh_dentry,
                                                                 MAY_WRITE|MAY_LOCAL_ACCESS);
                                        if (nfserr && nfserr != nfserr_rofs)