Btrfs: small fixes for find_lock_delalloc_range.
authorYan <yanzheng@21cn.com>
Thu, 1 Nov 2007 15:28:42 +0000 (11:28 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:03:57 +0000 (11:03 -0400)
There is a 'finish_wait', but no 'prepare_to_wait' . So I think that
the 'prepare_to_wait' is missing. The second change is  according to
the name of variable.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent_map.c

index 44be9cfd30eeb2b5666a2e1e7241fe2d0b86b184..ff8881fb56d6bf611ed805a26fe3fa728682d446 100644 (file)
@@ -1044,6 +1044,8 @@ search_again:
                        if (state->state & EXTENT_LOCKED) {
                                DEFINE_WAIT(wait);
                                atomic_inc(&state->refs);
+                               prepare_to_wait(&state->wq, &wait,
+                                               TASK_UNINTERRUPTIBLE);
                                write_unlock_irq(&tree->lock);
                                schedule();
                                write_lock_irq(&tree->lock);
@@ -1059,7 +1061,7 @@ search_again:
                node = rb_next(node);
                if (!node)
                        break;
-               total_bytes = state->end - state->start + 1;
+               total_bytes += state->end - state->start + 1;
                if (total_bytes >= max_bytes)
                        break;
        }