From 1f19f33e45791ea59aed048796fc68672c6723a5 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Sat, 25 Apr 2026 19:59:05 -0400 Subject: docs: Removed Precompiled HTML --- static/freebsd/man9/dev_refthread.9 3.html | 125 ----------------------------- 1 file changed, 125 deletions(-) delete mode 100644 static/freebsd/man9/dev_refthread.9 3.html (limited to 'static/freebsd/man9/dev_refthread.9 3.html') diff --git a/static/freebsd/man9/dev_refthread.9 3.html b/static/freebsd/man9/dev_refthread.9 3.html deleted file mode 100644 index 9ca70fac..00000000 --- a/static/freebsd/man9/dev_refthread.9 3.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - -
DEV_REFTHREAD(9)Kernel Developer's ManualDEV_REFTHREAD(9)
-
-
-

-

dev_refthread, - devvn_refthread, - dev_relthreadsafely - access device methods

-
-
-

-

#include - <sys/param.h> -
- #include <sys/conf.h>

-

struct cdevsw * -
- dev_refthread(struct - cdev *dev, int - *ref);

-

struct cdevsw * -
- devvn_refthread(struct - vnode *vp, struct cdev - **devp, int - *ref);

-

void -
- dev_relthread(struct - cdev *dev, int - ref);

-
-
-

-

The - () - (or devvn_refthread()) and - dev_relthread() routines provide a safe way to - access devfs(4) devices that may be concurrently destroyed - by - () - (e.g., removable media).

-

If successful, - () - and devvn_refthread() acquire a "thread - reference" to the associated struct cdev and - return a non-NULL pointer to the cdev's struct cdevsw - method table. For the duration of that reference, the cdev's associated - private data and method table object are valid. Destruction of the cdev - sleeps until the thread reference is released.

-

A reference cannot prevent media removal. It - is an implementation detail of individual drivers how method calls from - callers with - () - references are handled when the device is pending destruction. A common - behavior for disk devices is to return the ENXIO - status, but that is not required by this KPI.

-

The - () - variant of dev_refthread() extracts the - struct cdev pointer out of the - VCHR vnode(9) automatically before - performing the same actions as dev_refthread(). - Additionally, a pointer to the struct cdev is returned - to the caller via *devp. - devvn_refthread() correctly handles possible - parallel reclamation of the vnode.

-

() - is used to release a reference to a struct cdev. - dev_relthread() - only - be invoked when the associated invocation of - dev_refthread() or - devvn_refthread() returned a non-NULL - struct cdevsw *.

-
-
-

-

struct cdev objects have two reference - counts, si_refcount and - si_threadcount. The - dev_refthread(), - devvn_refthread(), and - dev_relthread() functions manipulate the - si_threadcount. The - si_threadcount reference guarantees the liveness of - the struct cdev object. The other - si_refcount reference provides only the weaker - guarantee that the memory backing the struct cdev has - not been freed.

-
-
-

-

If dev_refthread() or - devvn_refthread() are unsuccessful, they return - NULL.

-
If these routines are unsuccessful, they do not increment the - struct cdev si_threadcount and do - not initialize the value pointed to by the *ref - parameter in any way.
-
-
-

-

devfs(4), destroy_dev(9)

-
-
-

-

Do not invoke dev_relthread() unless the - matching refthread routine succeeded!

-
-
- - - - - -
August 29, 2018FreeBSD 15.0
-- cgit v1.2.3