Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47836
b: refs/heads/master
c: 5e6a07d
h: refs/heads/master
v: v3
  • Loading branch information
David Chinner authored and Tim Shimmin committed Feb 10, 2007
1 parent 4cb6030 commit ce90ecf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 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: dc74eaad8cda9f12a885639b4f2513c99e9b483a
refs/heads/master: 5e6a07dfe404cd4d8494d842b54706cb007fa04b
15 changes: 7 additions & 8 deletions trunk/fs/xfs/linux-2.6/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,22 +1687,23 @@ STATIC int
xfs_buf_delwri_split(
xfs_buftarg_t *target,
struct list_head *list,
unsigned long age,
int flags)
unsigned long age)
{
xfs_buf_t *bp, *n;
struct list_head *dwq = &target->bt_delwrite_queue;
spinlock_t *dwlk = &target->bt_delwrite_lock;
int skipped = 0;
int force;

force = test_and_clear_bit(XBT_FORCE_FLUSH, &target->bt_flags);
INIT_LIST_HEAD(list);
spin_lock(dwlk);
list_for_each_entry_safe(bp, n, dwq, b_list) {
XB_TRACE(bp, "walkq1", (long)xfs_buf_ispin(bp));
ASSERT(bp->b_flags & XBF_DELWRI);

if (!xfs_buf_ispin(bp) && !xfs_buf_cond_lock(bp)) {
if (!(flags & XBT_FORCE_FLUSH) &&
if (!force &&
time_before(jiffies, bp->b_queuetime + age)) {
xfs_buf_unlock(bp);
break;
Expand Down Expand Up @@ -1744,9 +1745,7 @@ xfsbufd(
xfs_buf_timer_centisecs * msecs_to_jiffies(10));

xfs_buf_delwri_split(target, &tmp,
xfs_buf_age_centisecs * msecs_to_jiffies(10),
test_bit(XBT_FORCE_FLUSH, &target->bt_flags)
? XBT_FORCE_FLUSH : 0);
xfs_buf_age_centisecs * msecs_to_jiffies(10));

count = 0;
while (!list_empty(&tmp)) {
Expand All @@ -1763,7 +1762,6 @@ xfsbufd(
if (count)
blk_run_address_space(target->bt_mapping);

clear_bit(XBT_FORCE_FLUSH, &target->bt_flags);
} while (!kthread_should_stop());

return 0;
Expand All @@ -1786,7 +1784,8 @@ xfs_flush_buftarg(
xfs_buf_runall_queues(xfsdatad_workqueue);
xfs_buf_runall_queues(xfslogd_workqueue);

pincount = xfs_buf_delwri_split(target, &tmp, 0, XBT_FORCE_FLUSH);
set_bit(XBT_FORCE_FLUSH, &target->bt_flags);
pincount = xfs_buf_delwri_split(target, &tmp, 0);

/*
* Dropped the delayed write list lock, now walk the temporary list
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/xfs/linux-2.6/xfs_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ typedef enum {
} xfs_buf_flags_t;

typedef enum {
XBT_FORCE_SLEEP = (0 << 1),
XBT_FORCE_FLUSH = (1 << 1),
XBT_FORCE_SLEEP = 0,
XBT_FORCE_FLUSH = 1,
} xfs_buftarg_flags_t;

typedef struct xfs_bufhash {
Expand Down

0 comments on commit ce90ecf

Please sign in to comment.