From patchwork Wed Jun 10 14:38:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [05/33] block: Add bio_list_peek() From: Geert Uytterhoeven X-Patchwork-Id: 28429 Message-Id: <1244644748-24211-6-git-send-email-Geert.Uytterhoeven@sonycom.com> To: Benjamin Herrenschmidt Cc: Geert Uytterhoeven , linuxppc-dev@ozlabs.org, Jens Axboe , cbe-oss-dev@ozlabs.org Date: Wed, 10 Jun 2009 16:38:40 +0200 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 Cc: Jens Axboe --- include/linux/bio.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index 7b214fd..618bb7d 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;