Date: Thu, 23 Nov 1995 13:15:11 -0800 (PST) From: Julian Elischer <julian@ref.tfs.com> To: hackers@freebsd.org Subject: VOP_RECLAIM and vnode references.. Message-ID: <199511232115.NAA11760@ref.tfs.com>
next in thread | raw e-mail | index | archive | help
In vclean() (the only usage of VOP_RECLAIM I have found) the following happens: If a vnode has no references, it's left that way.. if it DOES have a reference (v_usecount > 0) then it's artificially incremented by one, to stop it going to 0 while the VOP_RECLAIM is active.. this is a bit stupid in my opinion... firstly, in devfs, my sanity code that checks that a vnode is referenced before it uses it, throws a fit when asked by devfs_reclaim to find the devfs_node associated with the vnode.. (this is why those of you that have made devfs report seeing "!no reference!" on the console.. secoondly, it's unknown how long a VOP_RECLAIM might take and something else may come in and raise and lower the reference count while it's happenning.. (not devfs, but their might be slower fs's) surely the v_usecount should be raised by one regardless of whether it is already non-zero.? the VOP_LOCK might make this un-needed, but I am loath to take the sanity check code out of my devfs code.. I figure that if I'm doing a vntodn() (vnode-to-devfsnode) then I should be doing it on a referenced vnode.. I don't like the fact that there is ONE exception.. "Except whenn asked to do it in a reclaim operation.." I guess I could do a vref in devfs_reclaim before calling vntodn() but why make a specific fix if a general one is just as easy? does anyone know why it's like it is? I BELIEVE (but don't know) that this is the only time when a vnode is passed toa filesystem without a reference.. julian +----------------------------------+ ______ _ __ | __--_|\ Julian Elischer | \ U \/ / On assignment | / \ julian@ref.tfs.com +------>x USA \ in a very strange | ( OZ ) 300 lakeside Dr. oakland CA. \___ ___ | country ! +- X_.---._/ USA+(510) 645-3137(wk) \_/ \\ v
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511232115.NAA11760>