Re: v_iocount and cache_lookup()
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com
I am looking at all vnode_get()s and vnode_put()s in my code and I have come across a piece of code that seems to assume that cache_lookup() returns with a v_iocount taken. I looked at cache_lookup() and I did not see any implicit vnode_get() or vnode_getiocount() when there's a positive match.
From bsd/vfs/vfs_cache.c:1369 - cache_lookup() (Latest Darwin sources)
/* We found a "positive" match, return the vnode */ if (vp) { NCHSTAT(ncs_goothds); vid = vp->v_id; NAME_CACHE_UNLOCK(); if (vnode_getwithvid(vp, vid)) { Note the last line (vnode_getwithvid()); that's what increments the iocount. So yes, cache_lookup() returns a vnode with an iocount. Also, looking at bsd/vfs/vfs_subr.c ... vnode_getiocount() is an internal function. --Ken _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Ken Hornstein