/* Locks a buffer object. Note that this in no way locks the underlying pages, so it is only useful for synchronizing concurrent use of buffer objects, not for synchronizing independent access to the underlying pages.  */
void xfs_buf_lock(xfs_buf_t *bp)
/* Locks a buffer object. Note that this in no way locks the underlying pages, so it is only useful for synchronizing concurrent use of buffer objects, not for synchronizing independent access to the underlying pages.  */
void xfs_buf_lock(xfs_buf_t *bp)
{
	trace_xfs_buf_lock(bp, _RET_IP_);
	if (atomic_read(&bp->b_io_remaining))
		blk_run_address_space(bp->b_target->bt_mapping);
	down(&bp->b_sema);
	XB_SET_OWNER(bp);
	trace_xfs_buf_lock_done(bp, _RET_IP_);
}