samba-technical@lists.samba.org
[Top] [All Lists]

Re: readahead() which is Linux-only vs. posix_fadvise()

Subject: Re: readahead) which is Linux-only vs. posix_fadvise(
From: Jeremy Allison
Date: Thu, 10 May 2007 12:08:47 -0700
On Wed, May 09, 2007 at 09:35:29PM -0400, derrell@xxxxxxxxx wrote:
> 
> The only place that readahead() is used, I think, is in vfs_readahead.c.
> It might make sense for the maintainer of this module to look into using
> posix_fadvise() instead of readahead().

Did you look at the code here :-) ? I'm guessing not....

#if defined(HAVE_LINUX_READAHEAD)
                int err = readahead(fromfd, offset, (size_t)rhd->len);
                DEBUG(10,("readahead_sendfile: readahead on fd %u,
offset %llu, len %u returned %d\n",
                        (unsigned int)fromfd,
                        (unsigned long long)offset,
                        (unsigned int)rhd->len,
                        err ));
#elif defined(HAVE_POSIX_FADVISE)
                int err = posix_fadvise(fromfd, offset, (off_t)rhd->len,
POSIX_FADV_WILLNEED);
                DEBUG(10,("readahead_sendfile: posix_fadvise on fd %u,
offset %llu, len %u returned %d\n",
                        (unsigned int)fromfd,
                        (unsigned long long)offset,
                        (unsigned int)rhd->len,
                        err ));
#else
                if (!rhd->didmsg) {
                        DEBUG(0,("readahead_sendfile: no readahead on
this platform\n"));
                        rhd->didmsg = True;
                }
#endif

<Prev in Thread] Current Thread [Next in Thread>