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

Function mqnode_release

freebsd/kern/uipc_mqueue.c:399–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399static __inline void
400mqnode_release(struct mqfs_node *node)
401{
402 struct mqfs_info *mqfs;
403 int old, exp;
404
405 mqfs = node->mn_info;
406 old = atomic_fetchadd_int(&node->mn_refcount, -1);
407 if (node->mn_type == mqfstype_dir ||
408 node->mn_type == mqfstype_root)
409 exp = 3; /* include . and .. */
410 else
411 exp = 1;
412 if (old == exp) {
413 int locked = sx_xlocked(&mqfs->mi_lock);
414 if (!locked)
415 sx_xlock(&mqfs->mi_lock);
416 mqfs_destroy(node);
417 if (!locked)
418 sx_xunlock(&mqfs->mi_lock);
419 }
420}
421
422/*
423 * Add a node to a directory

Callers 7

mqfs_lookupxFunction · 0.85
mqfs_createFunction · 0.85
do_unlinkFunction · 0.85
mqfs_reclaimFunction · 0.85
mqfs_mkdirFunction · 0.85
mqfs_rmdirFunction · 0.85
mqf_closeFunction · 0.85

Calls 2

mqfs_destroyFunction · 0.85
atomic_fetchadd_intFunction · 0.50

Tested by

no test coverage detected