Re: filemap_fdatawait() wait_on_page_writeback_range(mapping, 0,-1)?

From: Andrew Morton
Date: Fri Aug 20 2004 - 03:56:46 EST


Anton Altaparmakov <aia21@xxxxxxxxx> wrote:
>
> > > */
> > > int filemap_fdatawait(struct address_space *mapping)
> > >
> > > - return wait_on_page_writeback_range(mapping, 0, -1);
> > > + return wait_on_page_writeback_range(mapping, 0, i_size_read(mapping->host));
> > > }
> >
> > That would need a >> PAGE_CACHE_SHIFT
>
> Um, what happens to the last partial page? Perhaps this is necessary:
>
> (i_size_read(mapping->host) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT

/*
* Wait for writeback to complete against pages indexed by start->end
* inclusive
*/
static int wait_on_page_writeback_range(struct address_space *mapping,
pgoff_t start, pgoff_t end)


(start,end) is an inclusive range specifically because of the
do-it-for-the-whole-file requirement.

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