summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2013-04-03 10:43:30 (GMT)
committerEmil Medve <Emilian.Medve@Freescale.com>2013-04-30 08:17:31 (GMT)
commitfca358c56b98565dffeeffe62a6c9448138f2cb5 (patch)
tree08777a0e7c4932cb8d7e102ffa97b8f6fbe89b49 /fs
parent876c673e89f5da0307803a4da4bdf9fdb6afcbee (diff)
downloadlinux-fsl-qoriq-fca358c56b98565dffeeffe62a6c9448138f2cb5.tar.xz
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/fscache/page.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index ff000e5..c84696c 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -796,11 +796,13 @@ void fscache_invalidate_writes(struct fscache_cookie *cookie)
_enter("");
- while (spin_lock(&cookie->stores_lock),
- n = radix_tree_gang_lookup_tag(&cookie->stores, results, 0,
- ARRAY_SIZE(results),
- FSCACHE_COOKIE_PENDING_TAG),
- n > 0) {
+ spin_lock(&cookie->stores_lock);
+ while (1) {
+ n = radix_tree_gang_lookup_tag(&cookie->stores, results, 0,
+ ARRAY_SIZE(results),
+ FSCACHE_COOKIE_PENDING_TAG);
+ if (n == 0)
+ break;
for (i = n - 1; i >= 0; i--) {
page = results[i];
radix_tree_delete(&cookie->stores, page->index);
@@ -810,6 +812,7 @@ void fscache_invalidate_writes(struct fscache_cookie *cookie)
for (i = n - 1; i >= 0; i--)
page_cache_release(results[i]);
+ spin_lock(&cookie->stores_lock);
}
spin_unlock(&cookie->stores_lock);