bcache: Fix heap_peek() macro
authorNicholas Swenson <nks@daterainc.com>
Thu, 24 Oct 2013 00:35:26 +0000 (17:35 -0700)
committerKent Overstreet <kmo@daterainc.com>
Mon, 16 Dec 2013 22:22:57 +0000 (14:22 -0800)
Signed-off-by: Nicholas Swenson <nks@daterainc.com>
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
drivers/md/bcache/util.h

index 362c4b3..1030c60 100644 (file)
@@ -110,7 +110,7 @@ do {                                                                        \
        _r;                                                             \
 })
 
-#define heap_peek(h)   ((h)->size ? (h)->data[0] : NULL)
+#define heap_peek(h)   ((h)->used ? (h)->data[0] : NULL)
 
 #define heap_full(h)   ((h)->used == (h)->size)