Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 May 2011 01:03:27 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Lev Serebryakov <lev@FreeBSD.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Does FreeBSD have replacement for posix_fadvice() or fcntl(F_RDADVISE)?
Message-ID:  <20110512230327.GA82602@stack.nl>
In-Reply-To: <1649118429.20110512113812@serebryakov.spb.ru>
References:  <1649118429.20110512113812@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 12, 2011 at 11:38:12AM +0400, Lev Serebryakov wrote:
>    Does FreeBSD have some custom call, which can be used where Linux
>  programs uses posix_fadvice() and DARWIN ones fcntl(F_RDADVISE)?

>    It is like madvise(2) but for file descriptors.

An effect like POSIX_FADV_SEQUENTIAL can be obtained with the
F_READAHEAD or F_RDAHEAD fcntl(2) requests. The implementation is
divided between the generic VFS layer and various filesystems (cd9660,
ext2fs, msdosfs, nfs, xfs and ufs appear to use the information to some
degree).

Setting readahead to 0 with the fcntl requests has little effect: it
resets the state of the sequential access detection heuristic but does
not disable it.

The O_DIRECT open(2) flag has an effect similar to what
POSIX_FADV_NOREUSE should do, except that it changes semantics by adding
alignment restrictions.

-- 
Jilles Tjoelker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110512230327.GA82602>