.. | .. |
---|
35 | 35 | goto out; |
---|
36 | 36 | } |
---|
37 | 37 | |
---|
38 | | - if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state)) |
---|
| 38 | + if (!test_bit(BTRFS_ROOT_SHAREABLE, &root->state)) |
---|
39 | 39 | goto out; |
---|
40 | 40 | |
---|
41 | 41 | path = btrfs_alloc_path(); |
---|
.. | .. |
---|
52 | 52 | u32 nritems; |
---|
53 | 53 | |
---|
54 | 54 | root_node = btrfs_lock_root_node(root); |
---|
55 | | - btrfs_set_lock_blocking(root_node); |
---|
| 55 | + btrfs_set_lock_blocking_write(root_node); |
---|
56 | 56 | nritems = btrfs_header_nritems(root_node); |
---|
57 | 57 | root->defrag_max.objectid = 0; |
---|
58 | 58 | /* from above we know this is not a leaf */ |
---|
.. | .. |
---|
133 | 133 | ret = 0; |
---|
134 | 134 | } |
---|
135 | 135 | done: |
---|
136 | | - if (ret != -EAGAIN) { |
---|
| 136 | + if (ret != -EAGAIN) |
---|
137 | 137 | memset(&root->defrag_progress, 0, |
---|
138 | 138 | sizeof(root->defrag_progress)); |
---|
139 | | - root->defrag_trans_start = trans->transid; |
---|
140 | | - } |
---|
| 139 | + |
---|
141 | 140 | return ret; |
---|
142 | 141 | } |
---|