FreeBSD/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
/*
 * Notify the arc that a block was freed, and thus will never be used again.
 */
Notify the arc that a block was freed, and thus will never be used again.
Notify the arc that a block was freed and thus will never be used again .
void
arc_freed(spa_t *spa, const blkptr_t *bp)
{
	arc_buf_hdr_t *hdr;
	kmutex_t *hash_lock;
	uint64_t guid = spa_load_guid(spa);
	ASSERT(!BP_IS_EMBEDDED(bp));
	hdr = buf_hash_find(guid, bp, &hash_lock);
	if (hdr == NULL)
		return;
	if (HDR_BUF_AVAILABLE(hdr)) {
		arc_buf_t *buf = hdr->b_l1hdr.b_buf;
		add_reference(hdr, hash_lock, FTAG);
		hdr->b_flags &= ~ARC_FLAG_BUF_AVAILABLE;
		mutex_exit(hash_lock);
		arc_release(buf, FTAG);
		(void) arc_buf_remove_ref(buf, FTAG);
	} else {
		mutex_exit(hash_lock);
	}
}
void arc_freed ( spa_t * spa , const blkptr_t * bp ) { arc_buf_hdr_t * hdr ; kmutex_t * hash_lock ; uint64_t guid = spa_load_guid ( spa ) ; ASSERT ( ! BP_IS_EMBEDDED ( bp ) ) ; hdr = buf_hash_find ( guid , bp , & hash_lock ) ; if ( hdr == NULL ) return ; if ( HDR_BUF_AVAILABLE ( hdr ) ) { arc_buf_t * buf = hdr -> b_l1hdr . b_buf ; add_reference ( hdr , hash_lock , FTAG ) ; hdr -> b_flags &= ~ ARC_FLAG_BUF_AVAILABLE ; mutex_exit ( hash_lock ) ; arc_release ( buf , FTAG ) ; ( void ) arc_buf_remove_ref ( buf , FTAG ) ; } else { mutex_exit ( hash_lock ) ; } }
Notify the arc that a block was freed, and thus will never be used again.
Notify the arc that a block was freed and thus will never be used again .