Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346734
b: refs/heads/master
c: 5f3ab90
h: refs/heads/master
v: v3
  • Loading branch information
Anand Jain authored and Chris Mason committed Dec 17, 2012
1 parent 9cee7f7 commit ce65b7d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 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: b8b8ff590f99678616f9ea85f5088542d1cfc0be
refs/heads/master: 5f3ab90a72f98adbf00c50ac2d4d2b47cf4a9685
16 changes: 8 additions & 8 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -5114,13 +5114,13 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
right_path->search_commit_root = 1;
right_path->skip_locking = 1;

spin_lock(&left_root->root_times_lock);
spin_lock(&left_root->root_item_lock);
left_start_ctransid = btrfs_root_ctransid(&left_root->root_item);
spin_unlock(&left_root->root_times_lock);
spin_unlock(&left_root->root_item_lock);

spin_lock(&right_root->root_times_lock);
spin_lock(&right_root->root_item_lock);
right_start_ctransid = btrfs_root_ctransid(&right_root->root_item);
spin_unlock(&right_root->root_times_lock);
spin_unlock(&right_root->root_item_lock);

trans = btrfs_join_transaction(left_root);
if (IS_ERR(trans)) {
Expand Down Expand Up @@ -5215,15 +5215,15 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
goto out;
}

spin_lock(&left_root->root_times_lock);
spin_lock(&left_root->root_item_lock);
ctransid = btrfs_root_ctransid(&left_root->root_item);
spin_unlock(&left_root->root_times_lock);
spin_unlock(&left_root->root_item_lock);
if (ctransid != left_start_ctransid)
left_start_ctransid = 0;

spin_lock(&right_root->root_times_lock);
spin_lock(&right_root->root_item_lock);
ctransid = btrfs_root_ctransid(&right_root->root_item);
spin_unlock(&right_root->root_times_lock);
spin_unlock(&right_root->root_item_lock);
if (ctransid != right_start_ctransid)
right_start_ctransid = 0;

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ struct btrfs_root {

int force_cow;

spinlock_t root_times_lock;
spinlock_t root_item_lock;
};

struct btrfs_ioctl_defrag_range_args {
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ static void __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
root->root_key.objectid = objectid;
root->anon_dev = 0;

spin_lock_init(&root->root_times_lock);
spin_lock_init(&root->root_item_lock);
}

static int __must_check find_and_setup_root(struct btrfs_root *tree_root,
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/btrfs/root-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans,
struct btrfs_root_item *item = &root->root_item;
struct timespec ct = CURRENT_TIME;

spin_lock(&root->root_times_lock);
spin_lock(&root->root_item_lock);
item->ctransid = cpu_to_le64(trans->transid);
item->ctime.sec = cpu_to_le64(ct.tv_sec);
item->ctime.nsec = cpu_to_le32(ct.tv_nsec);
spin_unlock(&root->root_times_lock);
spin_unlock(&root->root_item_lock);
}
8 changes: 4 additions & 4 deletions trunk/fs/btrfs/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -4397,9 +4397,9 @@ static int full_send_tree(struct send_ctx *sctx)
if (!path)
return -ENOMEM;

spin_lock(&send_root->root_times_lock);
spin_lock(&send_root->root_item_lock);
start_ctransid = btrfs_root_ctransid(&send_root->root_item);
spin_unlock(&send_root->root_times_lock);
spin_unlock(&send_root->root_item_lock);

key.objectid = BTRFS_FIRST_FREE_OBJECTID;
key.type = BTRFS_INODE_ITEM_KEY;
Expand All @@ -4422,9 +4422,9 @@ static int full_send_tree(struct send_ctx *sctx)
* Make sure the tree has not changed after re-joining. We detect this
* by comparing start_ctransid and ctransid. They should always match.
*/
spin_lock(&send_root->root_times_lock);
spin_lock(&send_root->root_item_lock);
ctransid = btrfs_root_ctransid(&send_root->root_item);
spin_unlock(&send_root->root_times_lock);
spin_unlock(&send_root->root_item_lock);

if (ctransid != start_ctransid) {
WARN(1, KERN_WARNING "btrfs: the root that you're trying to "
Expand Down

0 comments on commit ce65b7d

Please sign in to comment.