[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAB4K4y429TFcsZHPtJ=fdDNarj1r-eorpT16xHpdMycjQNUgbQ@mail.gmail.com>
Date: Fri, 23 Dec 2011 18:53:00 +0530
From: Ajeet Yadav <ajeet.yadav.77@...il.com>
To: Phillip Lougher <phillip@...ashfs.org.uk>,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] Squashfs: Its safe to unlock cache after wake_up*
>From 21d714543579c20d9b01dc958d0af80b14b390cf Mon Sep 17 00:00:00 2001
From: Ajeet Yadav <ajeet.yadav.77@...il.com>
Date: Fri, 23 Dec 2011 18:02:32 +0530
Subject: [PATCH 2/2] Squashfs: Its safe to unlock cache after wake_up*
wake_up* calls are non sleeping varients, its safe to
call spin_unlock(cache->lock) after them.
Signed-off-by: Ajeet Yadav <ajeet.yadav.77@...il.com>
---
fs/squashfs/cache.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c
index 88d986a..1f5a685 100644
--- a/fs/squashfs/cache.c
+++ b/fs/squashfs/cache.c
@@ -131,11 +131,10 @@ struct squashfs_cache_entry
*squashfs_cache_get(struct super_block *sb,
* have looked it up in the cache, and have slept
* waiting for it to become available.
*/
- if (entry->num_waiters) {
- spin_unlock(&cache->lock);
+ if (entry->num_waiters)
wake_up_all(&entry->wait_queue);
- } else
- spin_unlock(&cache->lock);
+
+ spin_unlock(&cache->lock);
goto out;
}
@@ -191,11 +190,8 @@ void squashfs_cache_put(struct squashfs_cache_entry *entry)
* If there's any processes waiting for a block to become
* available, wake one up.
*/
- if (cache->num_waiters) {
- spin_unlock(&cache->lock);
+ if (cache->num_waiters)
wake_up(&cache->wait_queue);
- return;
- }
}
spin_unlock(&cache->lock);
}
--
1.6.0.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists