*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> vinvalbuf (9)              



NAME    [Toc]    [Back]

     vinvalbuf -- flushes and invalidates all buffers associated with a vnode

SYNOPSIS    [Toc]    [Back]

     #include <sys/param.h>
     #include <sys/vnode.h>

     vinvalbuf(struct vnode *vp, int flags, struct ucred *cred,
	 struct thread *td, int slpflag, int slptimeo);

DESCRIPTION    [Toc]    [Back]

     The vinvalbuf() function invalidates all of the buffers associated with
     the given vnode.  This includes buffers on the clean list and the dirty
     list.  If the V_SAVE flag is specified then the buffers on the dirty list
     are synced prior to being released.  If there is a VM Object associated
     with the vnode, it is removed.

     Its arguments are:

     vp        A pointer to the vnode whose buffers will be invalidated.

     flags     The only supported flag is V_SAVE and it indicates that dirty
	       buffers should be synced with the disk.

     cred      The user credentials that are used to VOP_FSYNC(9) buffers if
	       V_SAVE is set.

     td        The thread responsible for this call.

     slpflag   The slp flag that will be used in the priority of any sleeps in
	       the function.

     slptimeo  The timeout for any sleeps in the function.

LOCKS    [Toc]    [Back]

     The vnode is assumed to be locked prior to the call and remains locked
     upon return.

     Giant must be held by prior to the call and remains locked upon return.

RETURN VALUES    [Toc]    [Back]

     A 0 value is returned on success.

PSEUDOCODE    [Toc]    [Back]

	   vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
	   error = vinvalbuf(devvp, V_SAVE, cred, td, 0, 0);
	   VOP_UNLOCK(devvp, 0, td);
	   if (error)
		   return (error);

ERRORS    [Toc]    [Back]

     [ENOSPC]		The file system is full.  (With V_SAVE)

     [EDQUOT]		Disc quota exceeded.  (With V_SAVE)

     [EWOULDBLOCK]	Sleep operation timed out.  (See slptimeo)

     [ERESTART] 	A signal needs to be delivered and the system call
			should be restarted.  (With PCATCH set in slpflag)

     [EINTR]		The system has been interrupted by a signal.  (With
			PCATCH set in slpflag)

SEE ALSO    [Toc]    [Back]

     brelse(9), bremfree(9), tsleep(9), VOP_FSYNC(9)

AUTHORS    [Toc]    [Back]

     This man page was written by Chad David <davidc@acns.ab.ca>.

FreeBSD 5.2.1			 July 7, 2001			 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
vinvalbuf OpenBSD flush and invalidate all buffers associated with a vnode
flushband Tru64 STREAMS: Flushes messages for a specified priority band
unimsg FreeBSD message buffers
sync Linux flush filesystem buffers
gldrawbuffer IRIX specify which color buffers are to be drawn into
getbuffer IRIX indicates which buffers are enabled for writing
glDrawBuffer Tru64 specify which color buffers are to be drawn into
glclearindex IRIX specify the clear value for the color index buffers
glxswapbuffers IRIX exchange front and back buffers
pbuf FreeBSD functions for managing physical buffers
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service