[Port-solaris] Re: EBUSY unmount check

Frank Batschulat (Home) Frank.Batschulat@Sun.COM
Thu, 29 Apr 2010 15:36:39 +0200

On Tue, 27 Apr 2010 18:41:24 +0200, Andrew Deason <adeason@sinenomine.net> wrote:

> This is perhaps a little bit stranger for us, since we never call
> vn_alloc due to the odd relationship between the OS's vnodes and AFS'
> vcaches, and we maintain our own pool of them. I still get what you're

hmm, I take this as that you somehow manage to magically kmem_alloc()
vnodes on the fly.

but you really, really want to start considering re-writing that part to
use the proper VnIF APIs: vn_alloc()/vn_free()/vn_reinit()/vn_recycle()


for solaris 10 and beyond in order to avoid any sort of havoc possibly
caused by not taking care of FEM monitors, vnode read/write counters
and fop stats data.

also, for the current dev release of Solaris, ie. OpenSolaris, we are now
able to distinguish between the vnode ref count v_count and holds
held on behalf of the DNLC v_count_dnlc, if AFS uses the DNLC,
that may come handy as well.

>>         - you should be implementing a VFS_FREEVFS() callback. once
>>           all references to a vfs_t are gone, the filesystem
>>           independend vfs layer will invoke VFS_FREEVFS() from
>>           VFS_RELE() so that the filesystem depended code can do it
>>           any possible still pending internal cleanup work needed and
>>           eventually frees the private data vfs_t->vfs_data.
> Okay, yeah, it looks like our "shut down afs" routine should just be
> called from there, instead of directly from our VFS_UNMOUNT.

I'd blissfully (not knowing the afs_unmount() code) say - yes! thats
the basic intent, in particular if you want to support forcible umounts
at some point. you can use pcfs or zfs as a reference any time at: