summaryrefslogtreecommitdiff
path: root/include/linux/bio.h
diff options
context:
space:
mode:
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>2009-06-10 04:38:40 +0000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-15 16:47:21 +1000
commit13685a1654b65357fb34066a98ef40445f7820fc (patch)
tree89a18aa144873b1224618fa399dd6654751ed2b6 /include/linux/bio.h
parentc2e95c6d7a9b9d8f023c3639edbb1da65ccd15ac (diff)
downloadlwn-13685a1654b65357fb34066a98ef40445f7820fc.tar.gz
lwn-13685a1654b65357fb34066a98ef40445f7820fc.zip
block: Add bio_list_peek()
Introduce bio_list_peek(), to obtain a pointer to the first bio on the bio_list without actually removing it from the list. This is needed when you want to serialize based on the list being empty or not. Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Acked-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include/linux/bio.h')
-rw-r--r--include/linux/bio.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 12737be58601..2a04eb54c0dd 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -590,6 +590,11 @@ static inline void bio_list_merge_head(struct bio_list *bl,
bl->head = bl2->head;
}
+static inline struct bio *bio_list_peek(struct bio_list *bl)
+{
+ return bl->head;
+}
+
static inline struct bio *bio_list_pop(struct bio_list *bl)
{
struct bio *bio = bl->head;