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

Function dev_refthread

freebsd/kern/kern_conf.c:178–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178struct cdevsw *
179dev_refthread(struct cdev *dev, int *ref)
180{
181 struct cdevsw *csw;
182 struct cdev_priv *cdp;
183
184 dev_lock_assert_unlocked();
185 if ((dev->si_flags & SI_ETERNAL) != 0) {
186 *ref = 0;
187 return (dev->si_devsw);
188 }
189 cdp = cdev2priv(dev);
190 mtx_lock(&cdp->cdp_threadlock);
191 csw = dev->si_devsw;
192 if (csw != NULL) {
193 if ((cdp->cdp_flags & CDP_SCHED_DTR) == 0)
194 atomic_add_long(&dev->si_threadcount, 1);
195 else
196 csw = NULL;
197 }
198 mtx_unlock(&cdp->cdp_threadlock);
199 if (csw != NULL)
200 *ref = 1;
201 return (csw);
202}
203
204struct cdevsw *
205devvn_refthread(struct vnode *vp, struct cdev **devp, int *ref)

Callers 14

giant_openFunction · 0.85
giant_fdopenFunction · 0.85
giant_closeFunction · 0.85
giant_strategyFunction · 0.85
giant_ioctlFunction · 0.85
giant_readFunction · 0.85
giant_writeFunction · 0.85
giant_pollFunction · 0.85
giant_kqfilterFunction · 0.85
giant_mmapFunction · 0.85
giant_mmap_singleFunction · 0.85
old_dev_pager_faultFunction · 0.85

Calls 3

atomic_add_longFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected