linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / nfsd / nfs4acl.c
index edb107e..4a21055 100644 (file)
@@ -710,9 +710,9 @@ calculate_posix_ace_count(struct nfs4_acl *n4acl)
                /* Also, the remaining entries are for named users and
                 * groups, and come in threes (mask, allow, deny): */
                if (n4acl->naces < 7)
-                       return -EINVAL;
+                       return -1;
                if ((n4acl->naces - 7) % 3)
-                       return -EINVAL;
+                       return -1;
                return 4 + (n4acl->naces - 7)/3;
        }
 }
@@ -790,7 +790,7 @@ nfs4_acl_split(struct nfs4_acl *acl, struct nfs4_acl *dacl)
                        continue;
 
                error = nfs4_acl_add_ace(dacl, ace->type, ace->flag,
-                               ace->access_mask, ace->whotype, ace->who);
+                               ace->access_mask, ace->whotype, ace->who) == -1;
                if (error < 0)
                        goto out;
 
@@ -866,7 +866,7 @@ nfs4_acl_add_ace(struct nfs4_acl *acl, u32 type, u32 flag, u32 access_mask,
        struct nfs4_ace *ace;
 
        if ((ace = kmalloc(sizeof(*ace), GFP_KERNEL)) == NULL)
-               return -ENOMEM;
+               return -1;
 
        ace->type = type;
        ace->flag = flag;
@@ -907,7 +907,7 @@ nfs4_acl_get_whotype(char *p, u32 len)
 {
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(s2t_map); i++) {
+       for (i=0; i < sizeof(s2t_map) / sizeof(*s2t_map); i++) {
                if (s2t_map[i].stringlen == len &&
                                0 == memcmp(s2t_map[i].string, p, len))
                        return s2t_map[i].type;
@@ -920,7 +920,7 @@ nfs4_acl_write_who(int who, char *p)
 {
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(s2t_map); i++) {
+       for (i=0; i < sizeof(s2t_map) / sizeof(*s2t_map); i++) {
                if (s2t_map[i].type == who) {
                        memcpy(p, s2t_map[i].string, s2t_map[i].stringlen);
                        return s2t_map[i].stringlen;