public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question on sys_readahead()
@ 2001-12-21 23:01 Michael Marxmeier
  2001-12-21 23:25 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Marxmeier @ 2001-12-21 23:01 UTC (permalink / raw)
  To: lkml

I have a question on sys_readahead and would appreciate 
some hint or a pointer.

- When was this call added?

- As far as i understand the code it reads the data into 
  the page cache. The data is ready sync and there is no
  way to do this async and have a notification unless using
  a separate thread.

A typical use i could see is preloading some data in the
page cache from a separate thread (eg. for a media player).

BTW: AFAICS the code is off by one if offset/count is not in 
PAGE_SIZE chunks? 

  unsigned long start = offset >> PAGE_CACHE_SHIFT;
  unsigned long len = (count + ((long)offset & ~PAGE_CACHE_MASK)) >> PAGE_CACHE_SHIFT;


Thanks
Michael

-- 
Michael Marxmeier           Marxmeier Software AG
E-Mail: mike@marxmeier.com  Besenbruchstrasse 9
Phone : +49 202 2431440     42285 Wuppertal, Germany
Fax   : +49 202 2431420     http://www.marxmeier.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-12-21 23:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-21 23:01 Question on sys_readahead() Michael Marxmeier
2001-12-21 23:25 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox