dm: bio list add bio_list_add_head
authorMikulas Patocka <mpatocka@redhat.com>
Thu, 2 Apr 2009 18:55:36 +0000 (19:55 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 2 Apr 2009 18:55:36 +0000 (19:55 +0100)
Introduce a function that adds a bio to the head of the list for
use by the patch that will support barriers.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-bio-list.h

index d4509be0fe67f78ecb91c0a5981d28ab9edd31cc..345098b4ca77ac77400c00e7598f2398bec04a06 100644 (file)
@@ -52,6 +52,16 @@ static inline void bio_list_add(struct bio_list *bl, struct bio *bio)
        bl->tail = bio;
 }
 
+static inline void bio_list_add_head(struct bio_list *bl, struct bio *bio)
+{
+       bio->bi_next = bl->head;
+
+       bl->head = bio;
+
+       if (!bl->tail)
+               bl->tail = bio;
+}
+
 static inline void bio_list_merge(struct bio_list *bl, struct bio_list *bl2)
 {
        if (!bl2->head)