nfsd: make fs/nfsd/vfs.h for common includes
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / nfsd / nfs2acl.c
index 1c3b7654e966d9f02cd46d8284ee636e670dd882..38c883d48b02430c52dcf74262775efd04d9633c 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/nfsd/xdr3.h>
 #include <linux/posix_acl.h>
 #include <linux/nfsacl.h>
+#include "vfs.h"
 
 #define NFSDDBG_FACILITY               NFSDDBG_PROC
 #define RETURN_STATUS(st)      { resp->status = (st); return (st); }
@@ -40,7 +41,8 @@ static __be32 nfsacld_proc_getacl(struct svc_rqst * rqstp,
        dprintk("nfsd: GETACL(2acl)   %s\n", SVCFH_fmt(&argp->fh));
 
        fh = fh_copy(&resp->fh, &argp->fh);
-       if ((nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_NOP)))
+       nfserr = fh_verify(rqstp, &resp->fh, 0, NFSD_MAY_NOP);
+       if (nfserr)
                RETURN_STATUS(nfserr);
 
        if (argp->mask & ~(NFS_ACL|NFS_ACLCNT|NFS_DFACL|NFS_DFACLCNT))
@@ -107,7 +109,7 @@ static __be32 nfsacld_proc_setacl(struct svc_rqst * rqstp,
        dprintk("nfsd: SETACL(2acl)   %s\n", SVCFH_fmt(&argp->fh));
 
        fh = fh_copy(&resp->fh, &argp->fh);
-       nfserr = fh_verify(rqstp, &resp->fh, 0, MAY_SATTR);
+       nfserr = fh_verify(rqstp, &resp->fh, 0, NFSD_MAY_SATTR);
 
        if (!nfserr) {
                nfserr = nfserrno( nfsd_set_posix_acl(
@@ -134,7 +136,7 @@ static __be32 nfsacld_proc_getattr(struct svc_rqst * rqstp,
        dprintk("nfsd: GETATTR  %s\n", SVCFH_fmt(&argp->fh));
 
        fh_copy(&resp->fh, &argp->fh);
-       return fh_verify(rqstp, &resp->fh, 0, MAY_NOP);
+       return fh_verify(rqstp, &resp->fh, 0, NFSD_MAY_NOP);
 }
 
 /*
@@ -216,6 +218,16 @@ static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p,
  * XDR encode functions
  */
 
+/*
+ * There must be an encoding function for void results so svc_process
+ * will work properly.
+ */
+int
+nfsaclsvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy)
+{
+       return xdr_ressize_check(rqstp, p);
+}
+
 /* GETACL */
 static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p,
                struct nfsd3_getaclres *resp)
@@ -307,7 +319,6 @@ static int nfsaclsvc_release_access(struct svc_rqst *rqstp, __be32 *p,
 }
 
 #define nfsaclsvc_decode_voidargs      NULL
-#define nfsaclsvc_encode_voidres       NULL
 #define nfsaclsvc_release_void         NULL
 #define nfsd3_fhandleargs      nfsd_fhandle
 #define nfsd3_attrstatres      nfsd_attrstat
@@ -345,5 +356,5 @@ struct svc_version  nfsd_acl_version2 = {
                .vs_proc        = nfsd_acl_procedures2,
                .vs_dispatch    = nfsd_dispatch,
                .vs_xdrsize     = NFS3_SVC_XDRSIZE,
-               .vs_hidden      = 1,
+               .vs_hidden      = 0,
 };