/* Release cache entry, once usage count is zero it can be reused.  */
void squashfs_cache_put(struct squashfs_cache_entry *entry)
/* Release cache entry, once usage count is zero it can be reused.  */
void squashfs_cache_put(struct squashfs_cache_entry *entry)
{
	struct squashfs_cache *cache = entry->cache;
	spin_lock(&cache->lock);
	entry->refcount--;
	if (entry->refcount == 0) {
		cache->unused++;
		if (cache->num_waiters) {
			spin_unlock(&cache->lock);
			wake_up(&cache->wait_queue);
			return;
		}
	}
	spin_unlock(&cache->lock);
}