/* To solve this we introduce l_pending_gen. A call to lockres_clear_pending() will only do so when it is passed a generation number that matches the lockres. lockres_set_pending() will return the current generation number. When ocfs2_cluster_lock() goes to clear PENDING, it passes the generation it got from set_pending(). In our example above, the generation numbers will  */
static void __lockres_clear_pending(struct ocfs2_lock_res *lockres, unsigned int generation, struct ocfs2_super *osb)
/* To solve this we introduce l_pending_gen. A call to lockres_clear_pending() will only do so when it is passed a generation number that matches the lockres. lockres_set_pending() will return the current generation number. When ocfs2_cluster_lock() goes to clear PENDING, it passes the generation it got from set_pending(). In our example above, the generation numbers will  */
static void __lockres_clear_pending(struct ocfs2_lock_res *lockres, unsigned int generation, struct ocfs2_super *osb)
{
	assert_spin_locked(&lockres->l_lock);
	if (!(lockres->l_flags & OCFS2_LOCK_PENDING) ||
	    (lockres->l_pending_gen != generation))
		return;
	lockres_clear_flags(lockres, OCFS2_LOCK_PENDING);
	lockres->l_pending_gen++;
	if (lockres->l_flags & OCFS2_LOCK_BLOCKED)
		ocfs2_wake_downconvert_thread(osb);
}