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

Function zfs_refcount_not_held

freebsd/contrib/openzfs/module/zfs/refcount.c:305–326  ·  view source on GitHub ↗

* If tracking is enabled, return true if a reference does not exist that * matches the "holder" tag. If tracking is disabled, always return true * since the reference might not be held. */

Source from the content-addressed store, hash-verified

303 * since the reference might not be held.
304 */
305boolean_t
306zfs_refcount_not_held(zfs_refcount_t *rc, const void *holder)
307{
308 reference_t *ref;
309
310 mutex_enter(&rc->rc_mtx);
311
312 if (!rc->rc_tracked) {
313 mutex_exit(&rc->rc_mtx);
314 return (B_TRUE);
315 }
316
317 for (ref = list_head(&rc->rc_list); ref;
318 ref = list_next(&rc->rc_list, ref)) {
319 if (ref->ref_holder == holder) {
320 mutex_exit(&rc->rc_mtx);
321 return (B_FALSE);
322 }
323 }
324 mutex_exit(&rc->rc_mtx);
325 return (B_TRUE);
326}
327#endif /* ZFS_DEBUG */

Callers 2

zio_doneFunction · 0.85

Calls 4

mutex_enterFunction · 0.85
mutex_exitFunction · 0.85
list_headFunction · 0.50
list_nextFunction · 0.50

Tested by

no test coverage detected