/* Insert a blocked lock into the global list  */
static void nlmsvc_insert_block(struct nlm_block *block, unsigned long)
/* Insert a blocked lock into the global list  */
static void nlmsvc_insert_block(struct nlm_block *block, unsigned long)
{
	struct nlm_block *b;
	struct list_head *pos;
	dprintk("lockd: nlmsvc_insert_block(%p, %ld)\n", block, when);
	if (list_empty(&block->b_list)) {
		kref_get(&block->b_count);
	} else {
		list_del_init(&block->b_list);
	}
	pos = &nlm_blocked;
	if (when != NLM_NEVER) {
		if ((when += jiffies) == NLM_NEVER)
			when ++;
		list_for_each(pos, &nlm_blocked) {
			b = list_entry(pos, struct nlm_block, b_list);
			if (time_after(b->b_when,when) || b->b_when == NLM_NEVER)
				break;
		}
	}
	list_add_tail(&block->b_list, pos);
	block->b_when = when;
}