Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
VOP_ADVISE(9)		 BSD Kernel Developer's	Manual		 VOP_ADVISE(9)

NAME
     VOP_ADVISE	-- apply advice	about use of file data

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

     int
     VOP_ADVISE(struct vnode *vp, off_t	start, off_t end, int advice);

DESCRIPTION
     This call applies advice for a range of a file's data.  It	is used	to im-
     plement the posix_fadvise system call.

     Its arguments are:

     vp	     The vnode of the file.

     start   The start of the range of file data.

     end     The end of	the range of file data.	 A value of OFF_MAX indicates
	     that the advice is	to be applied up to the	end of the file.

     advice  The type of operation to apply to the file	data.  Possible	values
	     are:

	     POSIX_FADV_WILLNEED  Initiate an asynchronous read	of the file
				  data if it is	not already resident.

	     POSIX_FADV_DONTNEED  Decrease the in-memory priority of clean
				  file data or discard clean file data.

     If	the start and end offsets are both zero, then the operation should be
     applied to	the entire file.  Note that this call is advisory only and may
     perform the requested operation on	a subset of the	requested range
     (including	not performing it at all) and still return success.

LOCKS
     The file should be	unlocked on entry.

RETURN VALUES
     Zero is returned if the call is successful, otherwise an appropriate er-
     ror code is returned.

ERRORS
     [EINVAL]		An invalid value was given for advice.

SEE ALSO
     vnode(9)

BSD			      September	26, 2015			   BSD

NAME | SYNOPSIS | DESCRIPTION | LOCKS | RETURN VALUES | ERRORS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=VOP_ADVISE&sektion=9&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help