Commit 31533fb263928c93a34cda41b66a6e83ade5c766
1 parent
85d4e46111
Exists in
master
and in
6 other branches
Btrfs: remove lockdep magic from btrfs_next_leaf
Before the reader/writer locks, btrfs_next_leaf needed to keep the path blocking to avoid making lockdep upset. Now that btrfs_next_leaf only takes read locks, this isn't required. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Showing 1 changed file with 5 additions and 31 deletions Side-by-side Diff
fs/btrfs/ctree.c
... | ... | @@ -4169,21 +4169,12 @@ |
4169 | 4169 | u32 nritems; |
4170 | 4170 | int ret; |
4171 | 4171 | int old_spinning = path->leave_spinning; |
4172 | - int force_blocking = 0; | |
4173 | 4172 | int next_rw_lock = 0; |
4174 | 4173 | |
4175 | 4174 | nritems = btrfs_header_nritems(path->nodes[0]); |
4176 | 4175 | if (nritems == 0) |
4177 | 4176 | return 1; |
4178 | 4177 | |
4179 | - /* | |
4180 | - * we take the blocks in an order that upsets lockdep. Using | |
4181 | - * blocking mode is the only way around it. | |
4182 | - */ | |
4183 | -#ifdef CONFIG_DEBUG_LOCK_ALLOC | |
4184 | - force_blocking = 1; | |
4185 | -#endif | |
4186 | - | |
4187 | 4178 | btrfs_item_key_to_cpu(path->nodes[0], &key, nritems - 1); |
4188 | 4179 | again: |
4189 | 4180 | level = 1; |
4190 | 4181 | |
... | ... | @@ -4192,10 +4183,8 @@ |
4192 | 4183 | btrfs_release_path(path); |
4193 | 4184 | |
4194 | 4185 | path->keep_locks = 1; |
4186 | + path->leave_spinning = 1; | |
4195 | 4187 | |
4196 | - if (!force_blocking) | |
4197 | - path->leave_spinning = 1; | |
4198 | - | |
4199 | 4188 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); |
4200 | 4189 | path->keep_locks = 0; |
4201 | 4190 | |
4202 | 4191 | |
4203 | 4192 | |
... | ... | @@ -4255,18 +4244,10 @@ |
4255 | 4244 | if (!ret) { |
4256 | 4245 | btrfs_set_path_blocking(path); |
4257 | 4246 | btrfs_tree_read_lock(next); |
4258 | - if (!force_blocking) { | |
4259 | - btrfs_clear_path_blocking(path, next, | |
4247 | + btrfs_clear_path_blocking(path, next, | |
4260 | 4248 | BTRFS_READ_LOCK); |
4261 | - } | |
4262 | 4249 | } |
4263 | - if (force_blocking) { | |
4264 | - btrfs_set_lock_blocking_rw(next, | |
4265 | - BTRFS_READ_LOCK); | |
4266 | - next_rw_lock = BTRFS_READ_LOCK_BLOCKING; | |
4267 | - } else { | |
4268 | - next_rw_lock = BTRFS_READ_LOCK; | |
4269 | - } | |
4250 | + next_rw_lock = BTRFS_READ_LOCK; | |
4270 | 4251 | } |
4271 | 4252 | break; |
4272 | 4253 | } |
4273 | 4254 | |
... | ... | @@ -4300,17 +4281,10 @@ |
4300 | 4281 | if (!ret) { |
4301 | 4282 | btrfs_set_path_blocking(path); |
4302 | 4283 | btrfs_tree_read_lock(next); |
4303 | - if (!force_blocking) | |
4304 | - btrfs_clear_path_blocking(path, next, | |
4284 | + btrfs_clear_path_blocking(path, next, | |
4305 | 4285 | BTRFS_READ_LOCK); |
4306 | 4286 | } |
4307 | - if (force_blocking) { | |
4308 | - btrfs_set_lock_blocking_rw(next, | |
4309 | - BTRFS_READ_LOCK); | |
4310 | - next_rw_lock = BTRFS_READ_LOCK_BLOCKING; | |
4311 | - } else { | |
4312 | - next_rw_lock = BTRFS_READ_LOCK; | |
4313 | - } | |
4287 | + next_rw_lock = BTRFS_READ_LOCK; | |
4314 | 4288 | } |
4315 | 4289 | } |
4316 | 4290 | ret = 0; |