23 #include <linux/module.h>
27 #include <linux/nfsacl.h>
28 #include <linux/nfs3.h>
37 struct xdr_array2_desc
desc;
51 xdr_nfsace_encode(
struct xdr_array2_desc *
desc,
void *
elem)
58 &nfsacl_desc->
acl->a_entries[nfsacl_desc->
count++];
61 switch(entry->
e_tag) {
93 struct posix_acl *acl,
int encode_entries,
int typeflag)
99 .array_len = encode_entries ? entries : 0,
100 .xcode = xdr_nfsace_encode,
113 if (encode_entries && acl && acl->
a_count == 3) {
129 nfsacl_desc.
acl = acl2;
133 err = 8 + nfsacl_desc.
desc.elem_size *
134 nfsacl_desc.
desc.array_len;
139 struct xdr_array2_desc desc;
145 xdr_nfsace_decode(
struct xdr_array2_desc *desc,
void *elem)
152 if (!nfsacl_desc->
acl) {
156 if (!nfsacl_desc->
acl)
158 nfsacl_desc->
count = 0;
161 entry = &nfsacl_desc->
acl->a_entries[nfsacl_desc->
count++];
166 switch(entry->
e_tag) {
187 cmp_acl_entry(
const void *
x,
const void *
y)
191 if (a->
e_tag != b->e_tag)
192 return a->
e_tag - b->e_tag;
193 else if (a->
e_id > b->e_id)
195 else if (a->
e_id < b->e_id)
205 posix_acl_from_nfsacl(
struct posix_acl *acl)
214 cmp_acl_entry,
NULL);
235 if (acl->
a_count == 4 && group_obj && mask &&
261 .xcode = pacl ? xdr_nfsace_decode :
NULL,
275 if (entries != nfsacl_desc.
desc.array_len ||
276 posix_acl_from_nfsacl(nfsacl_desc.
acl) != 0) {
277 posix_acl_release(nfsacl_desc.
acl);
280 *pacl = nfsacl_desc.
acl;
284 return 8 + nfsacl_desc.
desc.elem_size *
285 nfsacl_desc.
desc.array_len;