fscache: Use wait_on_bit() to wait for the freeing of relinquished volume
[linux-2.6-microblaze.git] / fs / fscache / volume.c
index ab8cedd..903af9d 100644 (file)
@@ -141,13 +141,14 @@ static bool fscache_is_acquire_pending(struct fscache_volume *volume)
 static void fscache_wait_on_volume_collision(struct fscache_volume *candidate,
                                             unsigned int collidee_debug_id)
 {
-       wait_var_event_timeout(&candidate->flags,
-                              !fscache_is_acquire_pending(candidate), 20 * HZ);
+       wait_on_bit_timeout(&candidate->flags, FSCACHE_VOLUME_ACQUIRE_PENDING,
+                           TASK_UNINTERRUPTIBLE, 20 * HZ);
        if (fscache_is_acquire_pending(candidate)) {
                pr_notice("Potential volume collision new=%08x old=%08x",
                          candidate->debug_id, collidee_debug_id);
                fscache_stat(&fscache_n_volumes_collision);
-               wait_var_event(&candidate->flags, !fscache_is_acquire_pending(candidate));
+               wait_on_bit(&candidate->flags, FSCACHE_VOLUME_ACQUIRE_PENDING,
+                           TASK_UNINTERRUPTIBLE);
        }
 }
 
@@ -347,8 +348,8 @@ static void fscache_wake_pending_volume(struct fscache_volume *volume,
        hlist_bl_for_each_entry(cursor, p, h, hash_link) {
                if (fscache_volume_same(cursor, volume)) {
                        fscache_see_volume(cursor, fscache_volume_see_hash_wake);
-                       clear_bit(FSCACHE_VOLUME_ACQUIRE_PENDING, &cursor->flags);
-                       wake_up_bit(&cursor->flags, FSCACHE_VOLUME_ACQUIRE_PENDING);
+                       clear_and_wake_up_bit(FSCACHE_VOLUME_ACQUIRE_PENDING,
+                                             &cursor->flags);
                        return;
                }
        }