Copyright (c) 1996 Doug Rabson All rights reserved. This program is free software. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in...
NAMEvget - get a vnode from the free list
SYNOPSISIn sys/param.h In sys/vnode.h Ft int Fn vget struct vnode *vp int lockflag struct thread *td
DESCRIPTIONGet a vnode from the free list and increment its reference count.
- Fa vp
- The vnode to remove from the free list.
- Fa lockflag
- If non-zero, the vnode will also be locked.
When not in use, vnodes are kept on a free list. The vnodes still reference valid files but may be reused to refer to a new file at any time. Often, these vnodes are also held in caches in the system, such as the name cache.
When a vnode which is on the free list is used again, for instance if the vnode was found in the name cache as a result of a call to VOP_LOOKUP9 then the new user must call Fn vget to increment the reference count and remove it from the free list.