diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 8a08f9443340..4112d53d4f4d 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -688,7 +688,9 @@ static noinline int drop_dirty_roots(struct btrfs_root *tree_root, | |||
688 | num_bytes -= btrfs_root_used(&dirty->root->root_item); | 688 | num_bytes -= btrfs_root_used(&dirty->root->root_item); |
689 | bytes_used = btrfs_root_used(&root->root_item); | 689 | bytes_used = btrfs_root_used(&root->root_item); |
690 | if (num_bytes) { | 690 | if (num_bytes) { |
691 | mutex_lock(&root->fs_info->trans_mutex); | ||
691 | btrfs_record_root_in_trans(root); | 692 | btrfs_record_root_in_trans(root); |
693 | mutex_unlock(&root->fs_info->trans_mutex); | ||
692 | btrfs_set_root_used(&root->root_item, | 694 | btrfs_set_root_used(&root->root_item, |
693 | bytes_used - num_bytes); | 695 | bytes_used - num_bytes); |
694 | } | 696 | } |
@@ -852,11 +854,9 @@ static noinline int create_pending_snapshots(struct btrfs_trans_handle *trans, | |||
852 | { | 854 | { |
853 | struct btrfs_pending_snapshot *pending; | 855 | struct btrfs_pending_snapshot *pending; |
854 | struct list_head *head = &trans->transaction->pending_snapshots; | 856 | struct list_head *head = &trans->transaction->pending_snapshots; |
855 | struct list_head *cur; | ||
856 | int ret; | 857 | int ret; |
857 | 858 | ||
858 | list_for_each(cur, head) { | 859 | list_for_each_entry(pending, head, list) { |
859 | pending = list_entry(cur, struct btrfs_pending_snapshot, list); | ||
860 | ret = create_pending_snapshot(trans, fs_info, pending); | 860 | ret = create_pending_snapshot(trans, fs_info, pending); |
861 | BUG_ON(ret); | 861 | BUG_ON(ret); |
862 | } | 862 | } |