Re: [PATCH 3/8] xfs: Introduce writeback context for writepages

Dave Chinner
2016-02-11T00:25:52Z

On Wed, Feb 10, 2016 at 03:31:26AM -0800, Christoph Hellwig wrote:
> > + struct xfs_writepage_ctx wpc = {
> > + .io_type = XFS_IO_OVERWRITE,
> > + };
> > + int ret;
> > +
> > + ret = xfs_do_writepage(page, wbc, &wpc);
> > + return xfs_writepage_submit(&wpc, wbc, ret);
> > +}
> > +
> > +STATIC int
> > xfs_vm_writepages(
> > struct address_space *mapping,
> > struct writeback_control *wbc)
> > {
> > + struct xfs_writepage_ctx wpc = {
> > + .io_type = XFS_IO_OVERWRITE,
> > + };
>
> Shouldn't we start out with an invalid (0) state, and just move
> the actual states up to start from 1?

This is just a translation of the existing code - the imap_valid
flag being initialised to zero ensures the io_type is correctly
initialised if it differs from XFS_IO_OVERWRITE. I guess there's no
harm in changing it.

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com