Add revoke_and_destroy_dev(), to be used by devices which decide when
they choose to destroy themselves without regard to whether or not they are open.
This commit is contained in:
parent
6112fceebd
commit
1fd9f8f438
@ -361,6 +361,19 @@ make_dev_alias(dev_t pdev, const char *fmt, ...)
|
||||
return (dev);
|
||||
}
|
||||
|
||||
void
|
||||
revoke_and_destroy_dev(dev_t dev)
|
||||
{
|
||||
struct vnode *vp;
|
||||
|
||||
GIANT_REQUIRED;
|
||||
|
||||
vp = SLIST_FIRST(&dev->si_hlist);
|
||||
if (vp != NULL)
|
||||
VOP_REVOKE(vp, REVOKEALL);
|
||||
destroy_dev(dev);
|
||||
}
|
||||
|
||||
void
|
||||
destroy_dev(dev_t dev)
|
||||
{
|
||||
|
@ -317,6 +317,7 @@ int cdevsw_add __P((struct cdevsw *new));
|
||||
int cdevsw_remove __P((struct cdevsw *old));
|
||||
int count_dev __P((dev_t dev));
|
||||
void destroy_dev __P((dev_t dev));
|
||||
void revoke_and_destroy_dev __P((dev_t dev));
|
||||
struct cdevsw *devsw __P((dev_t dev));
|
||||
const char *devtoname __P((dev_t dev));
|
||||
int dev_named __P((dev_t pdev, const char *name));
|
||||
|
@ -317,6 +317,7 @@ int cdevsw_add __P((struct cdevsw *new));
|
||||
int cdevsw_remove __P((struct cdevsw *old));
|
||||
int count_dev __P((dev_t dev));
|
||||
void destroy_dev __P((dev_t dev));
|
||||
void revoke_and_destroy_dev __P((dev_t dev));
|
||||
struct cdevsw *devsw __P((dev_t dev));
|
||||
const char *devtoname __P((dev_t dev));
|
||||
int dev_named __P((dev_t pdev, const char *name));
|
||||
|
Loading…
Reference in New Issue
Block a user