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

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

	chain = ip->chain;
	KKASSERT(chain != NULL);	/* for now */
	hammer2_chain_lock(ip->hmp, chain, HAMMER2_RESOLVE_ALWAYS);

	return (chain);
}
/*
 * HAMMER2 inode locks
 *
 * HAMMER2 offers shared locks and exclusive locks on inodes.
 *
 * An inode's ip->chain pointer is resolved and stable while an inode is
 * locked, and can be cleaned out at any time (become NULL) when an inode
 * is not locked.
 *
 * The underlying chain is also locked and returned.
 *
 * NOTE: We don't combine the inode/chain lock because putting away an
 *       inode would otherwise confuse multiple lock holders of the inode.
 */
HAMMER2 inode locks
HAMMER2 offers shared locks and exclusive locks on inodes.

An inode's ip->chain pointer is resolved and stable while an inode is
locked, and can be cleaned out at any time (become NULL) when an inode
is not locked.

The underlying chain is also locked and returned.

We don't combine the inode/chain lock because putting away an
inode would otherwise confuse multiple lock holders of the inode.
HAMMER2 inode locks HAMMER2 offers shared locks and exclusive locks on inodes . An inode ' s ip - > chain pointer is resolved and stable while an inode is locked and can be cleaned out at any time ( become NULL ) when an inode is not locked . The underlying chain is also locked and returned . We don ' t combine the inode / chain lock because putting away an inode would otherwise confuse multiple lock holders of the inode .
hammer2_chain_t *
hammer2_inode_lock_ex(hammer2_inode_t *ip)
{
	hammer2_chain_t *chain;
	hammer2_inode_ref(ip);
	ccms_thread_lock(&ip->topo_cst, CCMS_STATE_EXCLUSIVE);
	chain = ip->chain;
	KKASSERT(chain != NULL);	
	hammer2_chain_lock(ip->hmp, chain, HAMMER2_RESOLVE_ALWAYS);
	return (chain);
}
hammer2_chain_t * hammer2_inode_lock_ex ( hammer2_inode_t * ip ) { hammer2_chain_t * chain ; hammer2_inode_ref ( ip ) ; ccms_thread_lock ( & ip -> topo_cst , CCMS_STATE_EXCLUSIVE ) ; chain = ip -> chain ; KKASSERT ( chain != NULL ) ; hammer2_chain_lock ( ip -> hmp , chain , HAMMER2_RESOLVE_ALWAYS ) ; return ( chain ) ; }
HAMMER2 inode locks
 HAMMER2 offers shared locks and exclusive locks on inodes.
HAMMER2 inode locks HAMMER2 offers shared locks and exclusive locks on inodes .
/* for now */