rv = auth_domain_lookup(name, NULL);
while(1) {
- if (rv != &new->h) {
- if (new) auth_domain_put(&new->h);
+ if (rv) {
+ if (new && rv != &new->h)
+ auth_domain_put(&new->h);
+
+ if (rv->flavour != &svcauth_unix) {
+ auth_domain_put(rv);
+ return NULL;
+ }
return rv;
}
- if (rv && rv->flavour != &svcauth_unix) {
- auth_domain_put(rv);
- return NULL;
- }
- if (rv)
- return rv;
new = kmalloc(sizeof(*new), GFP_KERNEL);
if (new == NULL)
};
static struct cache_head *ip_table[IP_HASHMAX];
-static void ip_map_put(struct cache_head *item, struct cache_detail *cd)
+static void ip_map_put(struct kref *kref)
{
+ struct cache_head *item = container_of(kref, struct cache_head, ref);
struct ip_map *im = container_of(item, struct ip_map,h);
- if (cache_put(item, cd)) {
- if (test_bit(CACHE_VALID, &item->flags) &&
- !test_bit(CACHE_NEGATIVE, &item->flags))
- auth_domain_put(&im->m_client->h);
- kfree(im);
- }
+
+ if (test_bit(CACHE_VALID, &item->flags) &&
+ !test_bit(CACHE_NEGATIVE, &item->flags))
+ auth_domain_put(&im->m_client->h);
+ kfree(im);
}
#if IP_HASHBITS == 8
hash_ip((unsigned long)ipm->m_addr.s_addr));
if (!ch)
return -ENOMEM;
- ip_map_put(ch, &ip_map_cache);
+ cache_put(ch, &ip_map_cache);
return 0;
}
rv = &ipm->m_client->h;
kref_get(&rv->ref);
}
- ip_map_put(&ipm->h, &ip_map_cache);
+ cache_put(&ipm->h, &ip_map_cache);
return rv;
}
case 0:
rqstp->rq_client = &ipm->m_client->h;
kref_get(&rqstp->rq_client->ref);
- ip_map_put(&ipm->h, &ip_map_cache);
+ cache_put(&ipm->h, &ip_map_cache);
break;
}
return SVC_OK;