Commit f5a99512 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] knfsd: rpc/svc auth_unix tidyup

Get auth_unix_lookup (maps IP address to clientname)
to use cache_check instead of checking the various state
bits manually.
parent b1321130
......@@ -268,20 +268,17 @@ struct auth_domain *auth_unix_lookup(struct in_addr addr)
if (!ipm)
return NULL;
if (cache_check(&ip_map_cache, &ipm->h, NULL))
return NULL;
if (test_bit(CACHE_VALID, &ipm->h.flags) &&
(ipm->m_client->addr_changes - ipm->m_add_change) >0)
if ((ipm->m_client->addr_changes - ipm->m_add_change) >0) {
set_bit(CACHE_NEGATIVE, &ipm->h.flags);
if (!test_bit(CACHE_VALID, &ipm->h.flags))
rv = NULL;
else if (test_bit(CACHE_NEGATIVE, &ipm->h.flags))
rv = NULL;
else {
} else {
rv = &ipm->m_client->h;
cache_get(&rv->h);
}
if (ipm) ip_map_put(&ipm->h, &ip_map_cache);
ip_map_put(&ipm->h, &ip_map_cache);
return rv;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment