Re: [PATCH 14/18] writeback: make writeback_control.nr_to_write straight

Dave Chinner
2011-05-19T23:29:15Z

On Fri, May 20, 2011 at 06:06:44AM +0800, Wu Fengguang wrote:
> : writeback_single_inode(inode, wb, &wbc);
> : work->nr_pages -= write_chunk - wbc.nr_to_write;
> : wrote += write_chunk - wbc.nr_to_write;
> : if (wbc.pages_skipped) {
> : /*
> : * writeback is not making progress due to locked
> : * buffers. Skip this inode for now.
> : */
> : redirty_tail(inode, wb);
> : - }
> : + } else if (!(inode->i_state & I_DIRTY))
> : + wrote++;
>
> It looks a bit more clean to do
>
> : wrote += write_chunk - wbc.nr_to_write;
> : + if (!(inode->i_state & I_DIRTY))
> : + wrote++;
> : if (wbc.pages_skipped) {
> : /*
> : * writeback is not making progress due to locked
> : * buffers. Skip this inode for now.
> : */
> : redirty_tail(inode, wb);
> : }

But it's still in the wrong place - such post-write inode dirty
processing is supposed to be isolated to writeback_single_inode().
Spreading it across multiple locations is not, IMO, the nicest thing
to do...

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com