aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorplougher <plougher>2009-01-31 07:31:30 +0000
committerplougher <plougher>2009-01-31 07:31:30 +0000
commit1014ca43a0489749a32a9658e45b724b869bf3d2 (patch)
tree6b8e923da6ac03998d3032a8b953b018864bf656 /kernel
parentdd94aafde599f4a3454b4ab80e4dd0bc6cacd962 (diff)
downloadsquashfs-tools-1014ca43a0489749a32a9658e45b724b869bf3d2.tar.gz
Rename waiting to num_waiters, making clear it is a count rather than a
boolean. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fs/squashfs/cache.c14
-rw-r--r--kernel/fs/squashfs/squashfs_fs_sb.h4
2 files changed, 9 insertions, 9 deletions
diff --git a/kernel/fs/squashfs/cache.c b/kernel/fs/squashfs/cache.c
index f8bb45f..a7faa37 100644
--- a/kernel/fs/squashfs/cache.c
+++ b/kernel/fs/squashfs/cache.c
@@ -68,11 +68,11 @@ struct squashfs_cache_entry *squashfs_cache_get(struct super_block *sb,
* go to sleep waiting for one to become available.
*/
if (cache->unused == 0) {
- cache->waiting++;
+ cache->num_waiters++;
spin_unlock(&cache->lock);
wait_event(cache->wait_queue, cache->unused);
spin_lock(&cache->lock);
- cache->waiting--;
+ cache->num_waiters--;
continue;
}
@@ -99,7 +99,7 @@ struct squashfs_cache_entry *squashfs_cache_get(struct super_block *sb,
entry->block = block;
entry->refcount = 1;
entry->pending = 1;
- entry->waiting = 0;
+ entry->num_waiters = 0;
entry->error = 0;
spin_unlock(&cache->lock);
@@ -120,7 +120,7 @@ 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->waiting)
+ if (entry->num_waiters)
wake_up_all(&entry->wait_queue);
goto out;
}
@@ -141,7 +141,7 @@ struct squashfs_cache_entry *squashfs_cache_get(struct super_block *sb,
* go to sleep waiting for it to become available.
*/
if (entry->pending) {
- entry->waiting++;
+ entry->num_waiters++;
spin_unlock(&cache->lock);
wait_event(entry->wait_queue, !entry->pending);
goto out;
@@ -178,7 +178,7 @@ 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->waiting)
+ if (cache->num_waiters)
wake_up(&cache->wait_queue);
} else {
spin_unlock(&cache->lock);
@@ -229,7 +229,7 @@ struct squashfs_cache *squashfs_cache_init(char *name, int entries,
cache->block_size = block_size;
cache->pages = block_size >> PAGE_CACHE_SHIFT;
cache->name = name;
- cache->waiting = 0;
+ cache->num_waiters = 0;
spin_lock_init(&cache->lock);
init_waitqueue_head(&cache->wait_queue);
diff --git a/kernel/fs/squashfs/squashfs_fs_sb.h b/kernel/fs/squashfs/squashfs_fs_sb.h
index 5c2fad0..5aac4f9 100644
--- a/kernel/fs/squashfs/squashfs_fs_sb.h
+++ b/kernel/fs/squashfs/squashfs_fs_sb.h
@@ -29,7 +29,7 @@ struct squashfs_cache {
char *name;
int entries;
int next_blk;
- int waiting;
+ int num_waiters;
int unused;
int block_size;
int pages;
@@ -45,7 +45,7 @@ struct squashfs_cache_entry {
long long next_index;
char pending;
char error;
- int waiting;
+ int num_waiters;
wait_queue_head_t wait_queue;
struct squashfs_cache *cache;
void **data;