kernels/linux-2.4.0/fs/lockd/clntlock.c
/*
 * The server lockd has called us back to tell us the lock was granted
 */
The server lockd has called us back to tell us the lock was granted
The server lockd has called us back to tell us the lock was granted
u32
nlmclnt_grant(struct nlm_lock *lock)
{
	struct nlm_wait	*block;
	for (block = nlm_blocked; block; block = block->b_next) {
		if (nlm_compare_locks(block->b_lock, &lock->fl))
			break;
	}
	if (block == NULL)
		return nlm_lck_denied;
	block->b_status = NLM_LCK_GRANTED;
	wake_up(&block->b_wait);
	return nlm_granted;
}
u32 nlmclnt_grant ( struct nlm_lock * lock ) { struct nlm_wait * block ; for ( block = nlm_blocked ; block ; block = block -> b_next ) { if ( nlm_compare_locks ( block -> b_lock , & lock -> fl ) ) break ; } if ( block == NULL ) return nlm_lck_denied ; block -> b_status = NLM_LCK_GRANTED ; wake_up ( & block -> b_wait ) ; return nlm_granted ; }
The server lockd has called us back to tell us the lock was granted
The server lockd has called us back to tell us the lock was granted
/*
	 * Look up blocked request based on arguments. 
	 * Warning: must not use cookie to match it!
	 */ /* Ooops, no blocked request found. */ /* Alright, we found the lock. Set the return status and
	 * wake up the caller.
	 */