]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: introduce xfs_buf_submit[_wait]
authorDave Chinner <dchinner@redhat.com>
Wed, 1 Oct 2014 23:05:14 +0000 (09:05 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 1 Oct 2014 23:05:14 +0000 (09:05 +1000)
commitcc55f24d221830466880d3bbff49d62a96d53685
tree568f8eaf78e34734a15ebaf3a9865cfc5c1d7581
parent3d99808c3910b4bf705a383c4b10ef740c9d471b
xfs: introduce xfs_buf_submit[_wait]

There is a lot of cookie-cutter code that looks like:

if (shutdown)
handle buffer error
xfs_buf_iorequest(bp)
error = xfs_buf_iowait(bp)
if (error)
handle buffer error

spread through XFS. There's significant complexity now in
xfs_buf_iorequest() to specifically handle this sort of synchronous
IO pattern, but there's all sorts of nasty surprises in different
error handling code dependent on who owns the buffer references and
the locks.

Pull this pattern into a single helper, where we can hide all the
synchronous IO warts and hence make the error handling for all the
callers much saner. This removes the need for a special extra
reference to protect IO completion processing, as we can now hold a
single reference across dispatch and waiting, simplifying the sync
IO smeantics and error handling.

In doing this, also rename xfs_buf_iorequest to xfs_buf_submit and
make it explicitly handle on asynchronous IO. This forces all users
to be switched specifically to one interface or the other and
removes any ambiguity between how the interfaces are to be used. It
also means that xfs_buf_iowait() goes away.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_log.c
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_trace.h
fs/xfs/xfs_trans_buf.c