/* Note: the caller must hold a reference to host. In case of failure, this reference will be released.  */
struct nlm_rqst* nlm_alloc_call(struct nlm_host *host)
/* Note: the caller must hold a reference to host. In case of failure, this reference will be released.  */
struct nlm_rqst* nlm_alloc_call(struct nlm_host *host)
{
	struct nlm_rqst	*call;
	for(;;) {
		call = kzalloc(sizeof(*call), GFP_KERNEL);
		if (call != NULL) {
			atomic_set(&call->a_count, 1);
			locks_init_lock(&call->a_args.lock.fl);
			locks_init_lock(&call->a_res.lock.fl);
			call->a_host = host;
			return call;
		}
		if (signalled())
			break;
		printk("nlm_alloc_call: failed, waiting for memory\n");
		schedule_timeout_interruptible(5*HZ);
	}
	nlm_release_host(host);
	return NULL;
}