blob: cbab1d2d8a750949c4ede993f03e31daac9a48b1 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +00002/*
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +00003 * Process version 2 NFSACL requests.
4 *
5 * Copyright (C) 2002-2003 Andreas Gruenbacher <agruen@suse.de>
6 */
7
Boaz Harrosh9a74af22009-12-03 20:30:56 +02008#include "nfsd.h"
9/* FIXME: nfsacl.h is a broken header */
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000010#include <linux/nfsacl.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090011#include <linux/gfp.h>
Boaz Harrosh9a74af22009-12-03 20:30:56 +020012#include "cache.h"
13#include "xdr3.h"
J. Bruce Fields0a3adad2009-11-04 18:12:35 -050014#include "vfs.h"
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000015
16#define NFSDDBG_FACILITY NFSDDBG_PROC
17#define RETURN_STATUS(st) { resp->status = (st); return (st); }
18
19/*
20 * NULL call.
21 */
Al Viro7111c662006-10-19 23:28:45 -070022static __be32
Christoph Hellwiga6beb732017-05-08 17:35:49 +020023nfsacld_proc_null(struct svc_rqst *rqstp)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000024{
25 return nfs_ok;
26}
27
28/*
29 * Get the Access and/or Default ACL of a file.
30 */
Christoph Hellwiga6beb732017-05-08 17:35:49 +020031static __be32 nfsacld_proc_getacl(struct svc_rqst *rqstp)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000032{
Christoph Hellwiga6beb732017-05-08 17:35:49 +020033 struct nfsd3_getaclargs *argp = rqstp->rq_argp;
34 struct nfsd3_getaclres *resp = rqstp->rq_resp;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000035 struct posix_acl *acl;
Christoph Hellwig4ac72492013-12-20 05:16:55 -080036 struct inode *inode;
37 svc_fh *fh;
Al Viroc4d987b2006-10-19 23:29:00 -070038 __be32 nfserr = 0;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000039
40 dprintk("nfsd: GETACL(2acl) %s\n", SVCFH_fmt(&argp->fh));
41
42 fh = fh_copy(&resp->fh, &argp->fh);
Miklos Szeredi8837abc2008-06-16 13:20:29 +020043 nfserr = fh_verify(rqstp, &resp->fh, 0, NFSD_MAY_NOP);
44 if (nfserr)
J. Bruce Fieldsac8587d2007-11-12 16:05:02 -050045 RETURN_STATUS(nfserr);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000046
David Howells2b0143b2015-03-17 22:25:59 +000047 inode = d_inode(fh->fh_dentry);
Christoph Hellwig4ac72492013-12-20 05:16:55 -080048
Kinglong Mee7b8f4582015-07-03 19:39:02 +080049 if (argp->mask & ~NFS_ACL_MASK)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000050 RETURN_STATUS(nfserr_inval);
51 resp->mask = argp->mask;
52
J. Bruce Fields4f4a4fa2013-02-01 15:13:04 -050053 nfserr = fh_getattr(fh, &resp->stat);
54 if (nfserr)
Kinglong Mee7b8f4582015-07-03 19:39:02 +080055 RETURN_STATUS(nfserr);
J. Bruce Fields4f4a4fa2013-02-01 15:13:04 -050056
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000057 if (resp->mask & (NFS_ACL|NFS_ACLCNT)) {
Christoph Hellwig4ac72492013-12-20 05:16:55 -080058 acl = get_acl(inode, ACL_TYPE_ACCESS);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000059 if (acl == NULL) {
60 /* Solaris returns the inode's minimum ACL. */
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000061 acl = posix_acl_from_mode(inode->i_mode, GFP_KERNEL);
62 }
Kinglong Mee35e634b2014-07-09 21:54:16 +080063 if (IS_ERR(acl)) {
64 nfserr = nfserrno(PTR_ERR(acl));
65 goto fail;
66 }
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000067 resp->acl_access = acl;
68 }
69 if (resp->mask & (NFS_DFACL|NFS_DFACLCNT)) {
70 /* Check how Solaris handles requests for the Default ACL
71 of a non-directory! */
Christoph Hellwig4ac72492013-12-20 05:16:55 -080072 acl = get_acl(inode, ACL_TYPE_DEFAULT);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000073 if (IS_ERR(acl)) {
Christoph Hellwig4ac72492013-12-20 05:16:55 -080074 nfserr = nfserrno(PTR_ERR(acl));
75 goto fail;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000076 }
77 resp->acl_default = acl;
78 }
79
80 /* resp->acl_{access,default} are released in nfssvc_release_getacl. */
81 RETURN_STATUS(0);
82
83fail:
84 posix_acl_release(resp->acl_access);
85 posix_acl_release(resp->acl_default);
86 RETURN_STATUS(nfserr);
87}
88
89/*
90 * Set the Access and/or Default ACL of a file.
91 */
Christoph Hellwiga6beb732017-05-08 17:35:49 +020092static __be32 nfsacld_proc_setacl(struct svc_rqst *rqstp)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000093{
Christoph Hellwiga6beb732017-05-08 17:35:49 +020094 struct nfsd3_setaclargs *argp = rqstp->rq_argp;
95 struct nfsd_attrstat *resp = rqstp->rq_resp;
Christoph Hellwig4ac72492013-12-20 05:16:55 -080096 struct inode *inode;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +000097 svc_fh *fh;
Al Viroc4d987b2006-10-19 23:29:00 -070098 __be32 nfserr = 0;
Christoph Hellwig4ac72492013-12-20 05:16:55 -080099 int error;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000100
101 dprintk("nfsd: SETACL(2acl) %s\n", SVCFH_fmt(&argp->fh));
102
103 fh = fh_copy(&resp->fh, &argp->fh);
Miklos Szeredi8837abc2008-06-16 13:20:29 +0200104 nfserr = fh_verify(rqstp, &resp->fh, 0, NFSD_MAY_SATTR);
Christoph Hellwig4ac72492013-12-20 05:16:55 -0800105 if (nfserr)
106 goto out;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000107
David Howells2b0143b2015-03-17 22:25:59 +0000108 inode = d_inode(fh->fh_dentry);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000109
Christoph Hellwig4ac72492013-12-20 05:16:55 -0800110 error = fh_want_write(fh);
111 if (error)
112 goto out_errno;
113
Ben Hutchings99965372016-06-22 19:43:35 +0100114 fh_lock(fh);
115
116 error = set_posix_acl(inode, ACL_TYPE_ACCESS, argp->acl_access);
Christoph Hellwig4ac72492013-12-20 05:16:55 -0800117 if (error)
Ben Hutchings99965372016-06-22 19:43:35 +0100118 goto out_drop_lock;
119 error = set_posix_acl(inode, ACL_TYPE_DEFAULT, argp->acl_default);
Christoph Hellwig4ac72492013-12-20 05:16:55 -0800120 if (error)
Ben Hutchings99965372016-06-22 19:43:35 +0100121 goto out_drop_lock;
122
123 fh_unlock(fh);
Christoph Hellwig4ac72492013-12-20 05:16:55 -0800124
125 fh_drop_write(fh);
126
127 nfserr = fh_getattr(fh, &resp->stat);
128
129out:
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000130 /* argp->acl_{access,default} may have been allocated in
131 nfssvc_decode_setaclargs. */
132 posix_acl_release(argp->acl_access);
133 posix_acl_release(argp->acl_default);
134 return nfserr;
Ben Hutchings99965372016-06-22 19:43:35 +0100135out_drop_lock:
136 fh_unlock(fh);
Christoph Hellwig4ac72492013-12-20 05:16:55 -0800137 fh_drop_write(fh);
138out_errno:
139 nfserr = nfserrno(error);
140 goto out;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000141}
142
143/*
144 * Check file attributes
145 */
Christoph Hellwiga6beb732017-05-08 17:35:49 +0200146static __be32 nfsacld_proc_getattr(struct svc_rqst *rqstp)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000147{
Christoph Hellwiga6beb732017-05-08 17:35:49 +0200148 struct nfsd_fhandle *argp = rqstp->rq_argp;
149 struct nfsd_attrstat *resp = rqstp->rq_resp;
J. Bruce Fields4f4a4fa2013-02-01 15:13:04 -0500150 __be32 nfserr;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000151 dprintk("nfsd: GETATTR %s\n", SVCFH_fmt(&argp->fh));
152
153 fh_copy(&resp->fh, &argp->fh);
J. Bruce Fields4f4a4fa2013-02-01 15:13:04 -0500154 nfserr = fh_verify(rqstp, &resp->fh, 0, NFSD_MAY_NOP);
155 if (nfserr)
156 return nfserr;
157 nfserr = fh_getattr(&resp->fh, &resp->stat);
158 return nfserr;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000159}
160
161/*
162 * Check file access
163 */
Christoph Hellwiga6beb732017-05-08 17:35:49 +0200164static __be32 nfsacld_proc_access(struct svc_rqst *rqstp)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000165{
Christoph Hellwiga6beb732017-05-08 17:35:49 +0200166 struct nfsd3_accessargs *argp = rqstp->rq_argp;
167 struct nfsd3_accessres *resp = rqstp->rq_resp;
Al Viroc4d987b2006-10-19 23:29:00 -0700168 __be32 nfserr;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000169
170 dprintk("nfsd: ACCESS(2acl) %s 0x%x\n",
171 SVCFH_fmt(&argp->fh),
172 argp->access);
173
174 fh_copy(&resp->fh, &argp->fh);
175 resp->access = argp->access;
176 nfserr = nfsd_access(rqstp, &resp->fh, &resp->access, NULL);
J. Bruce Fields4f4a4fa2013-02-01 15:13:04 -0500177 if (nfserr)
178 return nfserr;
179 nfserr = fh_getattr(&resp->fh, &resp->stat);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000180 return nfserr;
181}
182
183/*
184 * XDR decode functions
185 */
Christoph Hellwig026fec72017-05-08 19:01:48 +0200186static int nfsaclsvc_decode_getaclargs(struct svc_rqst *rqstp, __be32 *p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000187{
Christoph Hellwig026fec72017-05-08 19:01:48 +0200188 struct nfsd3_getaclargs *argp = rqstp->rq_argp;
189
Benoit Tained40aa332014-05-22 16:32:30 +0200190 p = nfs2svc_decode_fh(p, &argp->fh);
191 if (!p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000192 return 0;
193 argp->mask = ntohl(*p); p++;
194
195 return xdr_argsize_check(rqstp, p);
196}
197
198
Christoph Hellwig026fec72017-05-08 19:01:48 +0200199static int nfsaclsvc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000200{
Christoph Hellwig026fec72017-05-08 19:01:48 +0200201 struct nfsd3_setaclargs *argp = rqstp->rq_argp;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000202 struct kvec *head = rqstp->rq_arg.head;
203 unsigned int base;
204 int n;
205
Benoit Tained40aa332014-05-22 16:32:30 +0200206 p = nfs2svc_decode_fh(p, &argp->fh);
207 if (!p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000208 return 0;
209 argp->mask = ntohl(*p++);
Kinglong Mee7b8f4582015-07-03 19:39:02 +0800210 if (argp->mask & ~NFS_ACL_MASK ||
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000211 !xdr_argsize_check(rqstp, p))
212 return 0;
213
214 base = (char *)p - (char *)head->iov_base;
215 n = nfsacl_decode(&rqstp->rq_arg, base, NULL,
216 (argp->mask & NFS_ACL) ?
217 &argp->acl_access : NULL);
218 if (n > 0)
219 n = nfsacl_decode(&rqstp->rq_arg, base + n, NULL,
220 (argp->mask & NFS_DFACL) ?
221 &argp->acl_default : NULL);
222 return (n > 0);
223}
224
Christoph Hellwig026fec72017-05-08 19:01:48 +0200225static int nfsaclsvc_decode_fhandleargs(struct svc_rqst *rqstp, __be32 *p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000226{
Christoph Hellwig026fec72017-05-08 19:01:48 +0200227 struct nfsd_fhandle *argp = rqstp->rq_argp;
228
Benoit Tained40aa332014-05-22 16:32:30 +0200229 p = nfs2svc_decode_fh(p, &argp->fh);
230 if (!p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000231 return 0;
232 return xdr_argsize_check(rqstp, p);
233}
234
Christoph Hellwig026fec72017-05-08 19:01:48 +0200235static int nfsaclsvc_decode_accessargs(struct svc_rqst *rqstp, __be32 *p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000236{
Christoph Hellwig026fec72017-05-08 19:01:48 +0200237 struct nfsd3_accessargs *argp = rqstp->rq_argp;
238
Benoit Tained40aa332014-05-22 16:32:30 +0200239 p = nfs2svc_decode_fh(p, &argp->fh);
240 if (!p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000241 return 0;
242 argp->access = ntohl(*p++);
243
244 return xdr_argsize_check(rqstp, p);
245}
246
247/*
248 * XDR encode functions
249 */
250
Peter Staubach1b7e0402009-11-02 16:59:07 -0500251/*
252 * There must be an encoding function for void results so svc_process
253 * will work properly.
254 */
Christoph Hellwig63f8de32017-05-08 19:42:02 +0200255static int nfsaclsvc_encode_voidres(struct svc_rqst *rqstp, __be32 *p)
Peter Staubach1b7e0402009-11-02 16:59:07 -0500256{
257 return xdr_ressize_check(rqstp, p);
258}
259
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000260/* GETACL */
Christoph Hellwig63f8de32017-05-08 19:42:02 +0200261static int nfsaclsvc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000262{
Christoph Hellwig63f8de32017-05-08 19:42:02 +0200263 struct nfsd3_getaclres *resp = rqstp->rq_resp;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000264 struct dentry *dentry = resp->fh.fh_dentry;
Prasad Paefa89d2007-10-24 15:14:32 -0500265 struct inode *inode;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000266 struct kvec *head = rqstp->rq_res.head;
267 unsigned int base;
268 int n;
Jesper Juhlcb65a5b2006-12-08 02:39:39 -0800269 int w;
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000270
Prasad Paefa89d2007-10-24 15:14:32 -0500271 /*
272 * Since this is version 2, the check for nfserr in
273 * nfsd_dispatch actually ensures the following cannot happen.
274 * However, it seems fragile to depend on that.
275 */
David Howells2b0143b2015-03-17 22:25:59 +0000276 if (dentry == NULL || d_really_is_negative(dentry))
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000277 return 0;
David Howells2b0143b2015-03-17 22:25:59 +0000278 inode = d_inode(dentry);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000279
J. Bruce Fields4f4a4fa2013-02-01 15:13:04 -0500280 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000281 *p++ = htonl(resp->mask);
282 if (!xdr_ressize_check(rqstp, p))
283 return 0;
284 base = (char *)p - (char *)head->iov_base;
285
Jesper Juhlcb65a5b2006-12-08 02:39:39 -0800286 rqstp->rq_res.page_len = w = nfsacl_size(
287 (resp->mask & NFS_ACL) ? resp->acl_access : NULL,
288 (resp->mask & NFS_DFACL) ? resp->acl_default : NULL);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000289 while (w > 0) {
J. Bruce Fieldsafc59402012-12-10 18:01:37 -0500290 if (!*(rqstp->rq_next_page++))
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000291 return 0;
292 w -= PAGE_SIZE;
293 }
294
295 n = nfsacl_encode(&rqstp->rq_res, base, inode,
296 resp->acl_access,
297 resp->mask & NFS_ACL, 0);
298 if (n > 0)
299 n = nfsacl_encode(&rqstp->rq_res, base + n, inode,
300 resp->acl_default,
301 resp->mask & NFS_DFACL,
302 NFS_ACL_DEFAULT);
Kinglong Mee7b8f4582015-07-03 19:39:02 +0800303 return (n > 0);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000304}
305
Christoph Hellwig63f8de32017-05-08 19:42:02 +0200306static int nfsaclsvc_encode_attrstatres(struct svc_rqst *rqstp, __be32 *p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000307{
Christoph Hellwig63f8de32017-05-08 19:42:02 +0200308 struct nfsd_attrstat *resp = rqstp->rq_resp;
309
J. Bruce Fields4f4a4fa2013-02-01 15:13:04 -0500310 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000311 return xdr_ressize_check(rqstp, p);
312}
313
314/* ACCESS */
Christoph Hellwig63f8de32017-05-08 19:42:02 +0200315static int nfsaclsvc_encode_accessres(struct svc_rqst *rqstp, __be32 *p)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000316{
Christoph Hellwig63f8de32017-05-08 19:42:02 +0200317 struct nfsd3_accessres *resp = rqstp->rq_resp;
318
J. Bruce Fields4f4a4fa2013-02-01 15:13:04 -0500319 p = nfs2svc_encode_fattr(rqstp, p, &resp->fh, &resp->stat);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000320 *p++ = htonl(resp->access);
321 return xdr_ressize_check(rqstp, p);
322}
323
324/*
325 * XDR release functions
326 */
Christoph Hellwig85374882017-05-08 18:48:24 +0200327static void nfsaclsvc_release_getacl(struct svc_rqst *rqstp)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000328{
Christoph Hellwig85374882017-05-08 18:48:24 +0200329 struct nfsd3_getaclres *resp = rqstp->rq_resp;
330
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000331 fh_put(&resp->fh);
332 posix_acl_release(resp->acl_access);
333 posix_acl_release(resp->acl_default);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000334}
335
Christoph Hellwig85374882017-05-08 18:48:24 +0200336static void nfsaclsvc_release_attrstat(struct svc_rqst *rqstp)
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000337{
Christoph Hellwig85374882017-05-08 18:48:24 +0200338 struct nfsd_attrstat *resp = rqstp->rq_resp;
339
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000340 fh_put(&resp->fh);
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000341}
342
Christoph Hellwig85374882017-05-08 18:48:24 +0200343static void nfsaclsvc_release_access(struct svc_rqst *rqstp)
Greg Banksc9ce2282007-02-20 10:12:34 +1100344{
Christoph Hellwig85374882017-05-08 18:48:24 +0200345 struct nfsd3_accessres *resp = rqstp->rq_resp;
346
347 fh_put(&resp->fh);
Greg Banksc9ce2282007-02-20 10:12:34 +1100348}
349
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000350#define nfsaclsvc_decode_voidargs NULL
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000351#define nfsaclsvc_release_void NULL
352#define nfsd3_fhandleargs nfsd_fhandle
353#define nfsd3_attrstatres nfsd_attrstat
354#define nfsd3_voidres nfsd3_voidargs
355struct nfsd3_voidargs { int dummy; };
356
Christoph Hellwigf7235b62017-05-08 17:59:13 +0200357#define PROC(name, argt, rest, relt, cache, respsize) \
358{ \
Christoph Hellwiga6beb732017-05-08 17:35:49 +0200359 .pc_func = nfsacld_proc_##name, \
Christoph Hellwig026fec72017-05-08 19:01:48 +0200360 .pc_decode = nfsaclsvc_decode_##argt##args, \
Christoph Hellwig63f8de32017-05-08 19:42:02 +0200361 .pc_encode = nfsaclsvc_encode_##rest##res, \
Christoph Hellwig85374882017-05-08 18:48:24 +0200362 .pc_release = nfsaclsvc_release_##relt, \
Christoph Hellwigf7235b62017-05-08 17:59:13 +0200363 .pc_argsize = sizeof(struct nfsd3_##argt##args), \
364 .pc_ressize = sizeof(struct nfsd3_##rest##res), \
365 .pc_cachetype = cache, \
366 .pc_xdrressize = respsize, \
367}
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000368
369#define ST 1 /* status*/
370#define AT 21 /* attributes */
371#define pAT (1+AT) /* post attributes - conditional */
372#define ACL (1+NFS_ACL_MAX_ENTRIES*3) /* Access Control List */
373
Christoph Hellwig860bda22017-05-12 16:11:49 +0200374static const struct svc_procedure nfsd_acl_procedures2[] = {
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000375 PROC(null, void, void, void, RC_NOCACHE, ST),
376 PROC(getacl, getacl, getacl, getacl, RC_NOCACHE, ST+1+2*(1+ACL)),
Greg Banksc9ce2282007-02-20 10:12:34 +1100377 PROC(setacl, setacl, attrstat, attrstat, RC_NOCACHE, ST+AT),
378 PROC(getattr, fhandle, attrstat, attrstat, RC_NOCACHE, ST+AT),
379 PROC(access, access, access, access, RC_NOCACHE, ST+AT+1),
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000380};
381
Christoph Hellwig7fd38af2017-05-08 23:40:27 +0200382static unsigned int nfsd_acl_count2[ARRAY_SIZE(nfsd_acl_procedures2)];
Christoph Hellwige9679182017-05-12 16:21:37 +0200383const struct svc_version nfsd_acl_version2 = {
384 .vs_vers = 2,
385 .vs_nproc = 5,
386 .vs_proc = nfsd_acl_procedures2,
387 .vs_count = nfsd_acl_count2,
388 .vs_dispatch = nfsd_dispatch,
389 .vs_xdrsize = NFS3_SVC_XDRSIZE,
Andreas Gruenbachera257cdd2005-06-22 17:16:26 +0000390};