xfs: don't release bios on completion immediately
authorDave Chinner <dchinner@redhat.com>
Tue, 5 Apr 2016 22:12:28 +0000 (08:12 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 5 Apr 2016 22:12:28 +0000 (08:12 +1000)
commit37992c18bba3f578860c6448b7bae18a14e535d3
tree9598b6b0af53ccdec9d3c650df4f82efc16c3ed3
parentbb18782aa47d8cde90fed5cb0af312642e98a4fa
xfs: don't release bios on completion immediately

Completion of an ioend requires us to walk the bufferhead list to
end writback on all the bufferheads. This, in turn, is needed so
that we can end writeback on all the pages we just did IO on.

To remove our dependency on bufferheads in writeback, we need to
turn this around the other way - we need to walk the pages we've
just completed IO on, and then walk the buffers attached to the
pages and complete their IO. In doing this, we remove the
requirement for the ioend to track bufferheads directly.

To enable IO completion to walk all the pages we've submitted IO on,
we need to keep the bios that we used for IO around until the ioend
has been completed. We can do this simply by chaining the bios to
the ioend at completion time, and then walking their pages directly
just before destroying the ioend.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
[hch: changed the xfs_finish_page_writeback calling convention]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_aops.c
fs/xfs/xfs_aops.h