lkml.org 
[lkml]   [2003]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How can I force a read to hit the disk?
On Mon, 8 Sep 2003, Richard B. Johnson wrote:

> On Mon, 8 Sep 2003, Alan Stern wrote:
>
> > I tried doing that, but it caused a segmentation violation. The trouble
> > was this line near the start of fs/direct_io.c:dio_refill_pages()
> >
> > down_read(&current->mm->mmap_sem);
> >
> > Unfortunately, in a kernel thread (which is where my code runs)
> > current->mm is NULL.
> >
> > Can anybody offer additional advice? How about a way to invalidate all
> > the page cache entries that contain a page from the file?
> >
> > Alan Stern
>
> When your thread code starts up, execute
> init_rwsem(&current->mm->mmap_sem);
>
> ... This is in the thread's code, not the module init code.

That doesn't work either; it also causes a segmentation violation. As I
said before, current->mm is NULL. It gets set that way by exit_mm() which
is called from daemonize().

Alan Stern

-
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:48    [W:0.069 / U:1.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site