MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dnode_add_ref

Function dnode_add_ref

freebsd/contrib/openzfs/module/zfs/dnode.c:1585–1596  ·  view source on GitHub ↗

* Can only add a reference if there is already at least one * reference on the dnode. Returns FALSE if unable to add a * new reference. */

Source from the content-addressed store, hash-verified

1583 * new reference.
1584 */
1585boolean_t
1586dnode_add_ref(dnode_t *dn, void *tag)
1587{
1588 mutex_enter(&dn->dn_mtx);
1589 if (zfs_refcount_is_zero(&dn->dn_holds)) {
1590 mutex_exit(&dn->dn_mtx);
1591 return (FALSE);
1592 }
1593 VERIFY(1 < zfs_refcount_add(&dn->dn_holds, tag));
1594 mutex_exit(&dn->dn_mtx);
1595 return (TRUE);
1596}
1597
1598void
1599dnode_rele(dnode_t *dn, void *tag)

Callers 4

dnode_setdirtyFunction · 0.85
dmu_objset_evict_dbufsFunction · 0.85
dmu_objset_sync_dnodesFunction · 0.85
dmu_bonus_hold_by_dnodeFunction · 0.85

Calls 4

mutex_enterFunction · 0.85
zfs_refcount_is_zeroFunction · 0.85
mutex_exitFunction · 0.85
zfs_refcount_addFunction · 0.85

Tested by

no test coverage detected