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>
This commit is contained in:
parent
cb65537ee1
commit
ee8be57bc3
@ -796,11 +796,16 @@ void fscache_invalidate_writes(struct fscache_cookie *cookie)
|
|||||||
|
|
||||||
_enter("");
|
_enter("");
|
||||||
|
|
||||||
while (spin_lock(&cookie->stores_lock),
|
for (;;) {
|
||||||
n = radix_tree_gang_lookup_tag(&cookie->stores, results, 0,
|
spin_lock(&cookie->stores_lock);
|
||||||
ARRAY_SIZE(results),
|
n = radix_tree_gang_lookup_tag(&cookie->stores, results, 0,
|
||||||
FSCACHE_COOKIE_PENDING_TAG),
|
ARRAY_SIZE(results),
|
||||||
n > 0) {
|
FSCACHE_COOKIE_PENDING_TAG);
|
||||||
|
if (n == 0) {
|
||||||
|
spin_unlock(&cookie->stores_lock);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = n - 1; i >= 0; i--) {
|
for (i = n - 1; i >= 0; i--) {
|
||||||
page = results[i];
|
page = results[i];
|
||||||
radix_tree_delete(&cookie->stores, page->index);
|
radix_tree_delete(&cookie->stores, page->index);
|
||||||
@ -812,7 +817,6 @@ void fscache_invalidate_writes(struct fscache_cookie *cookie)
|
|||||||
page_cache_release(results[i]);
|
page_cache_release(results[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock(&cookie->stores_lock);
|
|
||||||
_leave("");
|
_leave("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user