diff options
| author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2013-05-10 14:50:24 -0400 |
|---|---|---|
| committer | David Howells <dhowells@redhat.com> | 2013-06-19 09:16:47 -0400 |
| commit | ee8be57bc331f00d520c4c8a78ffa9590ed41c2c (patch) | |
| tree | b7033ab0c9a2836105da401a0de09278139fa759 | |
| parent | cb65537ee1134d3cc55c1fa83952bc8eb1212833 (diff) | |
fs/fscache: remove spin_lock() from the condition in while()
The spinlock() within the condition in while() will cause a compile error
if it is not a function. This is not a problem on mainline but it does not
look pretty and there is no reason to do it that way.
That patch writes it a little differently and avoids the double condition.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-By: Milosz Tanski <milosz@adfin.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
| -rw-r--r-- | fs/fscache/page.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/fscache/page.c b/fs/fscache/page.c index ff000e52072d..4882c806253f 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c | |||
| @@ -796,11 +796,16 @@ void fscache_invalidate_writes(struct fscache_cookie *cookie) | |||
| 796 | 796 | ||
| 797 | _enter(""); | 797 | _enter(""); |
| 798 | 798 | ||
| 799 | while (spin_lock(&cookie->stores_lock), | 799 | for (;;) { |
| 800 | n = radix_tree_gang_lookup_tag(&cookie->stores, results, 0, | 800 | spin_lock(&cookie->stores_lock); |
| 801 | ARRAY_SIZE(results), | 801 | n = radix_tree_gang_lookup_tag(&cookie->stores, results, 0, |
| 802 | FSCACHE_COOKIE_PENDING_TAG), | 802 | ARRAY_SIZE(results), |
| 803 | n > 0) { | 803 | FSCACHE_COOKIE_PENDING_TAG); |
| 804 | if (n == 0) { | ||
| 805 | spin_unlock(&cookie->stores_lock); | ||
| 806 | break; | ||
| 807 | } | ||
| 808 | |||
| 804 | for (i = n - 1; i >= 0; i--) { | 809 | for (i = n - 1; i >= 0; i--) { |
| 805 | page = results[i]; | 810 | page = results[i]; |
| 806 | radix_tree_delete(&cookie->stores, page->index); | 811 | radix_tree_delete(&cookie->stores, page->index); |
| @@ -812,7 +817,6 @@ void fscache_invalidate_writes(struct fscache_cookie *cookie) | |||
| 812 | page_cache_release(results[i]); | 817 | page_cache_release(results[i]); |
| 813 | } | 818 | } |
| 814 | 819 | ||
| 815 | spin_unlock(&cookie->stores_lock); | ||
| 816 | _leave(""); | 820 | _leave(""); |
| 817 | } | 821 | } |
| 818 | 822 | ||
