Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269868
b: refs/heads/master
c: 5a8ee6b
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Alex Elder committed Oct 12, 2011
1 parent 801f3c7 commit e5f4130
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 527cfdf19dd538a5a9e46b9bed0f30a38c28438d
refs/heads/master: 5a8ee6bafdd0ab8555adceac8b2cec539a552a1f
31 changes: 12 additions & 19 deletions trunk/fs/xfs/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,11 +937,8 @@ void
xfs_buf_unlock(
struct xfs_buf *bp)
{
if ((bp->b_flags & (XBF_DELWRI|_XBF_DELWRI_Q)) == XBF_DELWRI) {
atomic_inc(&bp->b_hold);
bp->b_flags |= XBF_ASYNC;
if ((bp->b_flags & (XBF_DELWRI|_XBF_DELWRI_Q)) == XBF_DELWRI)
xfs_buf_delwri_queue(bp);
}

XB_CLEAR_OWNER(bp);
up(&bp->b_sema);
Expand Down Expand Up @@ -1046,11 +1043,8 @@ xfs_bdwrite(
{
trace_xfs_buf_bdwrite(bp, _RET_IP_);

bp->b_flags &= ~XBF_READ;
bp->b_flags |= (XBF_DELWRI | XBF_ASYNC);

xfs_buf_delwri_queue(bp);
xfs_buf_unlock(bp);
xfs_buf_relse(bp);
}

/*
Expand Down Expand Up @@ -1570,23 +1564,22 @@ xfs_buf_delwri_queue(

trace_xfs_buf_delwri_queue(bp, _RET_IP_);

ASSERT((bp->b_flags&(XBF_DELWRI|XBF_ASYNC)) == (XBF_DELWRI|XBF_ASYNC));
ASSERT(!(bp->b_flags & XBF_READ));

spin_lock(dwlk);
/* If already in the queue, dequeue and place at tail */
if (!list_empty(&bp->b_list)) {
/* if already in the queue, move it to the tail */
ASSERT(bp->b_flags & _XBF_DELWRI_Q);
atomic_dec(&bp->b_hold);
list_del(&bp->b_list);
}

if (list_empty(dwq)) {
list_move_tail(&bp->b_list, dwq);
} else {
/* start xfsbufd as it is about to have something to do */
wake_up_process(bp->b_target->bt_task);
}
if (list_empty(dwq))
wake_up_process(bp->b_target->bt_task);

bp->b_flags |= _XBF_DELWRI_Q;
list_add_tail(&bp->b_list, dwq);
atomic_inc(&bp->b_hold);
bp->b_flags |= XBF_DELWRI | _XBF_DELWRI_Q | XBF_ASYNC;
list_add_tail(&bp->b_list, dwq);
}
bp->b_queuetime = jiffies;
spin_unlock(dwlk);
}
Expand Down

0 comments on commit e5f4130

Please sign in to comment.