Skip to content

Commit

Permalink
block: Add bio_list_peek()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geert Uytterhoeven authored and Benjamin Herrenschmidt committed Jun 15, 2009
1 parent c2e95c6 commit 13685a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/linux/bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 13685a1

Please sign in to comment.