• Andrew Morton's avatar
    [PATCH] implement posix_fadvise64() · fccbe384
    Andrew Morton authored
    An implementation of posix_fadvise64().  It adds 368 bytes to my vmlinux and
    is worth it.
    
    I didn't bother doing posix_fadvise(), as userspace can implement that by
    calling fadvise64().
    
    The main reason for wanting this syscall is to provide userspace with the
    ability to explicitly shoot down pagecache when streaming large files.  This
    is what O_STEAMING does, only posix_fadvise() is standards-based, and harder
    to use.
    
    posix_fadvise() also subsumes sys_readahead().
    
    POSIX_FADV_WILLNEED will generally provide asynchronous readahead semantics
    for small amounts of I/O.  As long as things like indirect blocks are aready
    in core.
    
    POSIX_FADV_RANDOM gives unprivileged applications a way of disabling
    readahead on a per-fd basis, which may provide some benefit for super-seeky
    access patterns such as databases.
    
    
    
    The POSIX_FADV_* values are already implemented in glibc, and this patch
    ensures that they are in sync.
    
    A test app (fadvise.c) is available in ext3 CVS.  See
    
    	http://www.zip.com.au/~akpm/linux/ext3/
    
    for CVS details.
    
    Ulrich has reviewed this patch (thanks).
    fccbe384
fadvise.c 1.49 KB