Re: invalidate_inode_pages in 2.5.32/3

Andrew Morton
2002-09-09T22:31:26Z

Daniel Phillips wrote:
>
> > > void invalidate_inode_pages(struct inode *inode)
> > > {
> > > truncate_inode_pages(mapping, 0);
> > > }
> > >
> > > Is it any harder than that?
> >
> > Pretty much - need to leave i_size where it was.
>
> This doesn't touch i_size.

Sorry - I was thinking vmtruncate(). truncate_inode_pages() would
result in all the mmapped pages becoming out-of-date anonymous
memory. NFS needs to take down the pagetables so that processes
which are mmapping the file which changed on the server will take
a major fault and read a fresh copy. I believe.