diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 4f43e227a297..1f1d89b18818 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1458,7 +1458,6 @@ static int transaction_kthread(void *arg) | |||
1458 | struct btrfs_root *root = arg; | 1458 | struct btrfs_root *root = arg; |
1459 | struct btrfs_trans_handle *trans; | 1459 | struct btrfs_trans_handle *trans; |
1460 | struct btrfs_transaction *cur; | 1460 | struct btrfs_transaction *cur; |
1461 | struct btrfs_fs_info *info = root->fs_info; | ||
1462 | unsigned long now; | 1461 | unsigned long now; |
1463 | unsigned long delay; | 1462 | unsigned long delay; |
1464 | int ret; | 1463 | int ret; |
@@ -1481,24 +1480,8 @@ static int transaction_kthread(void *arg) | |||
1481 | 1480 | ||
1482 | now = get_seconds(); | 1481 | now = get_seconds(); |
1483 | if (now < cur->start_time || now - cur->start_time < 30) { | 1482 | if (now < cur->start_time || now - cur->start_time < 30) { |
1484 | unsigned long num_delayed; | ||
1485 | num_delayed = cur->delayed_refs.num_entries; | ||
1486 | mutex_unlock(&root->fs_info->trans_mutex); | 1483 | mutex_unlock(&root->fs_info->trans_mutex); |
1487 | delay = HZ * 5; | 1484 | delay = HZ * 5; |
1488 | |||
1489 | /* | ||
1490 | * we may have been woken up early to start | ||
1491 | * processing the delayed extent ref updates | ||
1492 | * If so, run some of them and then loop around again | ||
1493 | * to see if we need to force a commit | ||
1494 | */ | ||
1495 | if (num_delayed > 64) { | ||
1496 | mutex_unlock(&info->transaction_kthread_mutex); | ||
1497 | trans = btrfs_start_transaction(root, 1); | ||
1498 | btrfs_run_delayed_refs(trans, root, 256); | ||
1499 | btrfs_end_transaction(trans, root); | ||
1500 | continue; | ||
1501 | } | ||
1502 | goto sleep; | 1485 | goto sleep; |
1503 | } | 1486 | } |
1504 | mutex_unlock(&root->fs_info->trans_mutex); | 1487 | mutex_unlock(&root->fs_info->trans_mutex); |