Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Dec 2001 12:17:05 -0700
From:      Brad Huntting <huntting@hunkular.glarp.com>
To:        Bruce M Simpson <bms@spc.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: closeing files in detach() 
Message-ID:  <200112161917.fBGJH5u00621@hunkular.glarp.com>
In-Reply-To: Your message of "Thu, 13 Dec 2001 23:24:46 GMT." <20011213232446.D17058@spc.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

>> There's a mention in the FBSD hacking guide that a detach() routine
>> for a device driver can forcably close all open descriptors for
>> its device before it unloads.
>> 
>> How does one do this?

> Check this out (from one of my USB device drivers I haven't yet
> forced upon the world):
> 
>         /* nuke the vnodes for any processes attached to us. */
>         vp = SLIST_FIRST(&sc->dev->si_hlist);
>         if (vp)
>                 VOP_REVOKE(vp, REVOKEALL);
>         destroy_dev(sc->dev);
> 
> This will cause all open fds for that device to be revoked.

Er...  Something is wrong here.  destroy_dev() supposedly takes a
dev_t which is typedef u_int32_t in <sys/types.h>.

Are we using the same OS?  I'm working with 4.4-RELEASE.


brad

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112161917.fBGJH5u00621>