[XFS] replace the XFS buf iodone semaphore with a completion
The xfs_buf_t b_iodonesema is really just a semaphore that wants to be a completion. Change it to a completion and remove the last user of the sema_t from XFS. SGI-PV: 981498 SGI-Modid: xfs-linux-melb:xfs-kern:31815a Signed-off-by: David Chinner <david@fromorbit.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
This commit is contained in:

committed by
Lachlan McIlroy

parent
12017faf38
commit
b4dd330b9e
@@ -253,7 +253,7 @@ _xfs_buf_initialize(
|
||||
|
||||
memset(bp, 0, sizeof(xfs_buf_t));
|
||||
atomic_set(&bp->b_hold, 1);
|
||||
init_MUTEX_LOCKED(&bp->b_iodonesema);
|
||||
init_completion(&bp->b_iowait);
|
||||
INIT_LIST_HEAD(&bp->b_list);
|
||||
INIT_LIST_HEAD(&bp->b_hash_list);
|
||||
init_MUTEX_LOCKED(&bp->b_sema); /* held, no waiters */
|
||||
@@ -1033,7 +1033,7 @@ xfs_buf_ioend(
|
||||
xfs_buf_iodone_work(&bp->b_iodone_work);
|
||||
}
|
||||
} else {
|
||||
up(&bp->b_iodonesema);
|
||||
complete(&bp->b_iowait);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1271,7 +1271,7 @@ xfs_buf_iowait(
|
||||
XB_TRACE(bp, "iowait", 0);
|
||||
if (atomic_read(&bp->b_io_remaining))
|
||||
blk_run_address_space(bp->b_target->bt_mapping);
|
||||
down(&bp->b_iodonesema);
|
||||
wait_for_completion(&bp->b_iowait);
|
||||
XB_TRACE(bp, "iowaited", (long)bp->b_error);
|
||||
return bp->b_error;
|
||||
}
|
||||
|
Reference in New Issue
Block a user