sys/vfs/hammer2/hammer2_subr.c
hammer2_chain_t *
hammer2_inode_lock_sh(hammer2_inode_t *ip)
{
	hammer2_chain_t *chain;

	hammer2_inode_ref(ip);
	ccms_thread_lock(&ip->topo_cst, CCMS_STATE_SHARED);

	chain = ip->chain;
	KKASSERT(chain != NULL);	/* for now */
	hammer2_chain_lock(ip->hmp, chain, HAMMER2_RESOLVE_ALWAYS |
					   HAMMER2_RESOLVE_SHARED);
	return (chain);
}
/*
 * NOTE: We don't combine the inode/chain lock because putting away an
 *       inode would otherwise confuse multiple lock holders of the inode.
 *
 *	 Shared locks are especially sensitive to having too many shared
 *	 lock counts (from the same thread) on certain paths which might
 *	 need to upgrade them.  Only one count of a shared lock can be
 *	 upgraded.
 */
We don't combine the inode/chain lock because putting away an
inode would otherwise confuse multiple lock holders of the inode.

Shared locks are especially sensitive to having too many shared
lock counts (from the same thread) on certain paths which might
need to upgrade them.  Only one count of a shared lock can be
upgraded.
We don ' t combine the inode / chain lock because putting away an inode would otherwise confuse multiple lock holders of the inode . Shared locks are especially sensitive to having too many shared lock counts ( from the same thread ) on certain paths which might need to upgrade them . Only one count of a shared lock can be upgraded .
hammer2_chain_t *
hammer2_inode_lock_sh(hammer2_inode_t *ip)
{
	hammer2_chain_t *chain;
	hammer2_inode_ref(ip);
	ccms_thread_lock(&ip->topo_cst, CCMS_STATE_SHARED);
	chain = ip->chain;
	KKASSERT(chain != NULL);	
	hammer2_chain_lock(ip->hmp, chain, HAMMER2_RESOLVE_ALWAYS |
					   HAMMER2_RESOLVE_SHARED);
	return (chain);
}
hammer2_chain_t * hammer2_inode_lock_sh ( hammer2_inode_t * ip ) { hammer2_chain_t * chain ; hammer2_inode_ref ( ip ) ; ccms_thread_lock ( & ip -> topo_cst , CCMS_STATE_SHARED ) ; chain = ip -> chain ; KKASSERT ( chain != NULL ) ; hammer2_chain_lock ( ip -> hmp , chain , HAMMER2_RESOLVE_ALWAYS | HAMMER2_RESOLVE_SHARED ) ; return ( chain ) ; }
NOTE: We don't combine the inode/chain lock because putting away an
       inode would otherwise confuse multiple lock holders of the inode.
NOTE : We don ' t combine the inode / chain lock because putting away an inode would otherwise confuse multiple lock holders of the inode .
/* for now */