Commit fe64e0d2 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: simplify xfs_ioend_can_merge

Compare the block layer status directly instead of converting it to
an errno first.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 7dbae9fb
...@@ -285,13 +285,9 @@ xfs_end_ioend( ...@@ -285,13 +285,9 @@ xfs_end_ioend(
static bool static bool
xfs_ioend_can_merge( xfs_ioend_can_merge(
struct xfs_ioend *ioend, struct xfs_ioend *ioend,
int ioend_error,
struct xfs_ioend *next) struct xfs_ioend *next)
{ {
int next_error; if (ioend->io_bio->bi_status != next->io_bio->bi_status)
next_error = blk_status_to_errno(next->io_bio->bi_status);
if (ioend_error != next_error)
return false; return false;
if ((ioend->io_fork == XFS_COW_FORK) ^ (next->io_fork == XFS_COW_FORK)) if ((ioend->io_fork == XFS_COW_FORK) ^ (next->io_fork == XFS_COW_FORK))
return false; return false;
...@@ -329,17 +325,11 @@ xfs_ioend_try_merge( ...@@ -329,17 +325,11 @@ xfs_ioend_try_merge(
struct list_head *more_ioends) struct list_head *more_ioends)
{ {
struct xfs_ioend *next_ioend; struct xfs_ioend *next_ioend;
int ioend_error;
if (list_empty(more_ioends))
return;
ioend_error = blk_status_to_errno(ioend->io_bio->bi_status);
while (!list_empty(more_ioends)) { while (!list_empty(more_ioends)) {
next_ioend = list_first_entry(more_ioends, struct xfs_ioend, next_ioend = list_first_entry(more_ioends, struct xfs_ioend,
io_list); io_list);
if (!xfs_ioend_can_merge(ioend, ioend_error, next_ioend)) if (!xfs_ioend_can_merge(ioend, next_ioend))
break; break;
list_move_tail(&next_ioend->io_list, &ioend->io_list); list_move_tail(&next_ioend->io_list, &ioend->io_list);
ioend->io_size += next_ioend->io_size; ioend->io_size += next_ioend->io_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment