diff options
author | David Sterba <dsterba@suse.cz> | 2011-05-02 09:29:25 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2011-05-02 09:29:25 -0400 |
commit | 8cc33e5c19bf01c7617608669be8c1b4f663eb2f (patch) | |
tree | 763f0db612327ccaea05a76139fd02ef6047d878 /fs/btrfs/extent-tree.c | |
parent | b3b4aa74b58bded927f579fff787fb6fa1c0393c (diff) |
btrfs: Document a mutex lock/unlock sequence
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a160f11465f8..fba1348cb2a0 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -756,6 +756,10 @@ again: | |||
756 | 756 | ||
757 | btrfs_release_path(path); | 757 | btrfs_release_path(path); |
758 | 758 | ||
759 | /* | ||
760 | * Mutex was contended, block until it's released and try | ||
761 | * again | ||
762 | */ | ||
759 | mutex_lock(&head->mutex); | 763 | mutex_lock(&head->mutex); |
760 | mutex_unlock(&head->mutex); | 764 | mutex_unlock(&head->mutex); |
761 | btrfs_put_delayed_ref(&head->node); | 765 | btrfs_put_delayed_ref(&head->node); |
@@ -2297,6 +2301,10 @@ again: | |||
2297 | atomic_inc(&ref->refs); | 2301 | atomic_inc(&ref->refs); |
2298 | 2302 | ||
2299 | spin_unlock(&delayed_refs->lock); | 2303 | spin_unlock(&delayed_refs->lock); |
2304 | /* | ||
2305 | * Mutex was contended, block until it's | ||
2306 | * released and try again | ||
2307 | */ | ||
2300 | mutex_lock(&head->mutex); | 2308 | mutex_lock(&head->mutex); |
2301 | mutex_unlock(&head->mutex); | 2309 | mutex_unlock(&head->mutex); |
2302 | 2310 | ||
@@ -2363,6 +2371,10 @@ static noinline int check_delayed_ref(struct btrfs_trans_handle *trans, | |||
2363 | 2371 | ||
2364 | btrfs_release_path(path); | 2372 | btrfs_release_path(path); |
2365 | 2373 | ||
2374 | /* | ||
2375 | * Mutex was contended, block until it's released and let | ||
2376 | * caller try again | ||
2377 | */ | ||
2366 | mutex_lock(&head->mutex); | 2378 | mutex_lock(&head->mutex); |
2367 | mutex_unlock(&head->mutex); | 2379 | mutex_unlock(&head->mutex); |
2368 | btrfs_put_delayed_ref(&head->node); | 2380 | btrfs_put_delayed_ref(&head->node); |