From: Geert Uytterhoeven Date: Wed, 10 Jun 2009 04:38:40 +0000 (+0000) Subject: block: Add bio_list_peek() X-Git-Tag: v2.6.31-rc1~314^2~14 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=13685a1654b65357fb34066a98ef40445f7820fc;p=~shefty%2Frdma-dev.git 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 Acked-by: Jens Axboe Signed-off-by: Benjamin Herrenschmidt --- diff --git a/include/linux/bio.h b/include/linux/bio.h index 12737be5860..2a04eb54c0d 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;