lkml.org 
[lkml]   [2003]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] first try for swap prefetch
Thomas Schlichter <schlicht@uni-mannheim.de> wrote:
>
> How can I get the file pointer for a buffered page with the information
> available in the kswapd (minly the page struct)??

You can't, really. There can be any number of file*'s pointing at an inode.

The pagefault handler will find it by find_vma(faulting_address)->vm_file.
Other codepaths use syscalls, and the user passed the file* in.

You can call page_cache_readahead() with a NULL file*. That'll mostly work
except for the odd filesytem like NFS which will oops. But it's good enough
for testing and development.

Or you could cook up a local file struct along the lines of
fs/nfsd/vfs.c:nfsd_read(), but I would not like to lead a young person
that way ;)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.073 / U:0.836 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site