diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-06-25 16:01:31 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:03 -0400 |
commit | a74a4b97b61beede185b4b3ad359d7d378b0d312 (patch) | |
tree | 49ce5e7698f08e84d0ad2f65768e9f34b64d79c5 /fs/btrfs/super.c | |
parent | 89ce8a63d0c761fbb02089850605360f389477d8 (diff) |
Btrfs: Replace the transaction work queue with kthreads
This creates one kthread for commits and one kthread for
deleting old snapshots. All the work queues are removed.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index b61ded7a20c9..726d6871fa13 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -340,7 +340,6 @@ static int btrfs_fill_super(struct super_block * sb, | |||
340 | goto fail_close; | 340 | goto fail_close; |
341 | 341 | ||
342 | sb->s_root = root_dentry; | 342 | sb->s_root = root_dentry; |
343 | btrfs_transaction_queue_work(tree_root, HZ * 30); | ||
344 | 343 | ||
345 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) | 344 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) |
346 | save_mount_options(sb, data); | 345 | save_mount_options(sb, data); |
@@ -416,9 +415,7 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags, | |||
416 | goto error_free_subvol_name; | 415 | goto error_free_subvol_name; |
417 | 416 | ||
418 | bdev = fs_devices->latest_bdev; | 417 | bdev = fs_devices->latest_bdev; |
419 | btrfs_lock_volumes(); | ||
420 | s = sget(fs_type, btrfs_test_super, set_anon_super, fs_devices); | 418 | s = sget(fs_type, btrfs_test_super, set_anon_super, fs_devices); |
421 | btrfs_unlock_volumes(); | ||
422 | if (IS_ERR(s)) | 419 | if (IS_ERR(s)) |
423 | goto error_s; | 420 | goto error_s; |
424 | 421 | ||
@@ -530,13 +527,15 @@ out: | |||
530 | static void btrfs_write_super_lockfs(struct super_block *sb) | 527 | static void btrfs_write_super_lockfs(struct super_block *sb) |
531 | { | 528 | { |
532 | struct btrfs_root *root = btrfs_sb(sb); | 529 | struct btrfs_root *root = btrfs_sb(sb); |
533 | btrfs_transaction_flush_work(root); | 530 | mutex_lock(&root->fs_info->transaction_kthread_mutex); |
531 | mutex_lock(&root->fs_info->cleaner_mutex); | ||
534 | } | 532 | } |
535 | 533 | ||
536 | static void btrfs_unlockfs(struct super_block *sb) | 534 | static void btrfs_unlockfs(struct super_block *sb) |
537 | { | 535 | { |
538 | struct btrfs_root *root = btrfs_sb(sb); | 536 | struct btrfs_root *root = btrfs_sb(sb); |
539 | btrfs_transaction_queue_work(root, HZ * 30); | 537 | mutex_unlock(&root->fs_info->cleaner_mutex); |
538 | mutex_unlock(&root->fs_info->transaction_kthread_mutex); | ||
540 | } | 539 | } |
541 | 540 | ||
542 | static struct super_operations btrfs_super_ops = { | 541 | static struct super_operations btrfs_super_ops = { |
@@ -589,10 +588,9 @@ static int __init init_btrfs_fs(void) | |||
589 | if (err) | 588 | if (err) |
590 | return err; | 589 | return err; |
591 | 590 | ||
592 | btrfs_init_transaction_sys(); | ||
593 | err = btrfs_init_cachep(); | 591 | err = btrfs_init_cachep(); |
594 | if (err) | 592 | if (err) |
595 | goto free_transaction_sys; | 593 | goto free_sysfs; |
596 | 594 | ||
597 | err = extent_io_init(); | 595 | err = extent_io_init(); |
598 | if (err) | 596 | if (err) |
@@ -618,15 +616,13 @@ free_extent_io: | |||
618 | extent_io_exit(); | 616 | extent_io_exit(); |
619 | free_cachep: | 617 | free_cachep: |
620 | btrfs_destroy_cachep(); | 618 | btrfs_destroy_cachep(); |
621 | free_transaction_sys: | 619 | free_sysfs: |
622 | btrfs_exit_transaction_sys(); | ||
623 | btrfs_exit_sysfs(); | 620 | btrfs_exit_sysfs(); |
624 | return err; | 621 | return err; |
625 | } | 622 | } |
626 | 623 | ||
627 | static void __exit exit_btrfs_fs(void) | 624 | static void __exit exit_btrfs_fs(void) |
628 | { | 625 | { |
629 | btrfs_exit_transaction_sys(); | ||
630 | btrfs_destroy_cachep(); | 626 | btrfs_destroy_cachep(); |
631 | extent_map_exit(); | 627 | extent_map_exit(); |
632 | extent_io_exit(); | 628 | extent_io_exit(); |