/* 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;
}
}
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;
struct nfs4_ace *ace;
if ((ace = kmalloc(sizeof(*ace), GFP_KERNEL)) == NULL)
- return -ENOMEM;
+ return -1;
ace->type = type;
ace->flag = flag;
{
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;
{
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;