disk-io.c (55eeaf0578038c40baaf3cf9408c23e42cd2a2b8) disk-io.c (161c3549b45aeef05451b6822d8aaaf39c7bedce)
1/*
2 * Copyright (C) 2007 Oracle. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 1253 unchanged lines hidden (view full) ---

1262 INIT_LIST_HEAD(&root->log_ctxs[1]);
1263 atomic_set(&root->log_commit[0], 0);
1264 atomic_set(&root->log_commit[1], 0);
1265 atomic_set(&root->log_writers, 0);
1266 atomic_set(&root->log_batch, 0);
1267 atomic_set(&root->orphan_inodes, 0);
1268 atomic_set(&root->refs, 1);
1269 atomic_set(&root->will_be_snapshoted, 0);
1/*
2 * Copyright (C) 2007 Oracle. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 1253 unchanged lines hidden (view full) ---

1262 INIT_LIST_HEAD(&root->log_ctxs[1]);
1263 atomic_set(&root->log_commit[0], 0);
1264 atomic_set(&root->log_commit[1], 0);
1265 atomic_set(&root->log_writers, 0);
1266 atomic_set(&root->log_batch, 0);
1267 atomic_set(&root->orphan_inodes, 0);
1268 atomic_set(&root->refs, 1);
1269 atomic_set(&root->will_be_snapshoted, 0);
1270 atomic_set(&root->qgroup_meta_rsv, 0);
1271 root->log_transid = 0;
1272 root->log_transid_committed = -1;
1273 root->last_log_commit = 0;
1274 if (fs_info)
1275 extent_io_tree_init(&root->dirty_log_pages,
1276 fs_info->btree_inode->i_mapping);
1277
1278 memset(&root->root_key, 0, sizeof(root->root_key));

--- 3043 unchanged lines hidden (view full) ---

4322 unpin = &root->fs_info->freed_extents[0];
4323 loop = false;
4324 goto again;
4325 }
4326
4327 return 0;
4328}
4329
1270 root->log_transid = 0;
1271 root->log_transid_committed = -1;
1272 root->last_log_commit = 0;
1273 if (fs_info)
1274 extent_io_tree_init(&root->dirty_log_pages,
1275 fs_info->btree_inode->i_mapping);
1276
1277 memset(&root->root_key, 0, sizeof(root->root_key));

--- 3043 unchanged lines hidden (view full) ---

4321 unpin = &root->fs_info->freed_extents[0];
4322 loop = false;
4323 goto again;
4324 }
4325
4326 return 0;
4327}
4328
4330static void btrfs_free_pending_ordered(struct btrfs_transaction *cur_trans,
4331 struct btrfs_fs_info *fs_info)
4332{
4333 struct btrfs_ordered_extent *ordered;
4334
4335 spin_lock(&fs_info->trans_lock);
4336 while (!list_empty(&cur_trans->pending_ordered)) {
4337 ordered = list_first_entry(&cur_trans->pending_ordered,
4338 struct btrfs_ordered_extent,
4339 trans_list);
4340 list_del_init(&ordered->trans_list);
4341 spin_unlock(&fs_info->trans_lock);
4342
4343 btrfs_put_ordered_extent(ordered);
4344 spin_lock(&fs_info->trans_lock);
4345 }
4346 spin_unlock(&fs_info->trans_lock);
4347}
4348
4349void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans,
4350 struct btrfs_root *root)
4351{
4352 btrfs_destroy_delayed_refs(cur_trans, root);
4353
4354 cur_trans->state = TRANS_STATE_COMMIT_START;
4355 wake_up(&root->fs_info->transaction_blocked_wait);
4356
4357 cur_trans->state = TRANS_STATE_UNBLOCKED;
4358 wake_up(&root->fs_info->transaction_wait);
4359
4329void btrfs_cleanup_one_transaction(struct btrfs_transaction *cur_trans,
4330 struct btrfs_root *root)
4331{
4332 btrfs_destroy_delayed_refs(cur_trans, root);
4333
4334 cur_trans->state = TRANS_STATE_COMMIT_START;
4335 wake_up(&root->fs_info->transaction_blocked_wait);
4336
4337 cur_trans->state = TRANS_STATE_UNBLOCKED;
4338 wake_up(&root->fs_info->transaction_wait);
4339
4360 btrfs_free_pending_ordered(cur_trans, root->fs_info);
4361 btrfs_destroy_delayed_inodes(root);
4362 btrfs_assert_delayed_root_empty(root);
4363
4364 btrfs_destroy_marked_extents(root, &cur_trans->dirty_pages,
4365 EXTENT_DIRTY);
4366 btrfs_destroy_pinned_extent(root,
4367 root->fs_info->pinned_extents);
4368

--- 69 unchanged lines hidden ---
4340 btrfs_destroy_delayed_inodes(root);
4341 btrfs_assert_delayed_root_empty(root);
4342
4343 btrfs_destroy_marked_extents(root, &cur_trans->dirty_pages,
4344 EXTENT_DIRTY);
4345 btrfs_destroy_pinned_extent(root,
4346 root->fs_info->pinned_extents);
4347

--- 69 unchanged lines hidden ---