/* Returns a matching nsm_handle if found in the nsm cache; the returned nsm_handle's reference count is bumped and sm_monitored is cleared. Otherwise returns NULL if some error occurred.  */
struct nsm_handle* nsm_reboot_lookup(const struct nlm_reboot *info)
/* Returns a matching nsm_handle if found in the nsm cache; the returned nsm_handle's reference count is bumped and sm_monitored is cleared. Otherwise returns NULL if some error occurred.  */
struct nsm_handle* nsm_reboot_lookup(const struct nlm_reboot *info)
{
	struct nsm_handle *cached;
	spin_lock(&nsm_lock);
	cached = nsm_lookup_priv(&info->priv);
	if (unlikely(cached == NULL)) {
		spin_unlock(&nsm_lock);
		dprintk("lockd: never saw rebooted peer '%.*s' before\n",
				info->len, info->mon);
		return cached;
	}
	atomic_inc(&cached->sm_count);
	spin_unlock(&nsm_lock);
	cached->sm_monitored = 0;
	dprintk("lockd: host %s (%s) rebooted, cnt %d\n",
			cached->sm_name, cached->sm_addrbuf,
			atomic_read(&cached->sm_count));
	return cached;
}