[PATCH] knfsd: nfsd4: represent nfsv4 acl with array instead of linked list

Simplify the memory management and code a bit by representing acls with an
array instead of a linked list.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
J. Bruce Fields
2007-02-16 01:28:30 -08:00
committed by Linus Torvalds
parent 575a6290f0
commit 28e05dd845
4 changed files with 67 additions and 137 deletions
+1 -2
View File
@@ -105,12 +105,11 @@ struct nfs4_ace {
uint32_t access_mask;
int whotype;
uid_t who;
struct list_head l_ace;
};
struct nfs4_acl {
uint32_t naces;
struct list_head ace_head;
struct nfs4_ace aces[0];
};
typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
+6 -3
View File
@@ -39,9 +39,12 @@
#include <linux/posix_acl.h>
struct nfs4_acl *nfs4_acl_new(void);
void nfs4_acl_free(struct nfs4_acl *);
int nfs4_acl_add_ace(struct nfs4_acl *, u32, u32, u32, int, uid_t);
/* Maximum ACL we'll accept from client; chosen (somewhat arbitrarily) to
* fit in a page: */
#define NFS4_ACL_MAX 170
struct nfs4_acl *nfs4_acl_new(int);
void nfs4_acl_add_ace(struct nfs4_acl *, u32, u32, u32, int, uid_t);
int nfs4_acl_get_whotype(char *, u32);
int nfs4_acl_write_who(int who, char *p);
int nfs4_acl_permission(struct nfs4_acl *acl, uid_t owner, gid_t group,