Move bio-list header file from drivers/md to linux/include Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> Signed-off-by: Mike Christie <michaelc@xxxxxxxxxxx> --- drivers/md/dm-bio-list.h | 71 --------------------------------------------- drivers/md/dm-mpath.c | 2 + drivers/md/dm-raid1.c | 2 + drivers/md/dm-snap.c | 2 + drivers/md/dm.c | 2 + drivers/md/raid1.c | 2 + drivers/md/raid10.c | 2 + include/linux/bio-list.h | 71 +++++++++++++++++++++++++++++++++++++++++++++ include/linux/raid/md_k.h | 3 +- 9 files changed, 78 insertions(+), 79 deletions(-) delete mode 100644 drivers/md/dm-bio-list.h create mode 100644 include/linux/bio-list.h 732b8a85158b1c773e9dfcfaf104d379451dddaf diff --git a/drivers/md/dm-bio-list.h b/drivers/md/dm-bio-list.h deleted file mode 100644 index bbf4615..0000000 --- a/drivers/md/dm-bio-list.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2004 Red Hat UK Ltd. - * - * This file is released under the GPL. - */ - -#ifndef DM_BIO_LIST_H -#define DM_BIO_LIST_H - -#include <linux/bio.h> - -struct bio_list { - struct bio *head; - struct bio *tail; -}; - -static inline void bio_list_init(struct bio_list *bl) -{ - bl->head = bl->tail = NULL; -} - -static inline void bio_list_add(struct bio_list *bl, struct bio *bio) -{ - bio->bi_next = NULL; - - if (bl->tail) - bl->tail->bi_next = bio; - else - bl->head = bio; - - bl->tail = bio; -} - -static inline void bio_list_merge(struct bio_list *bl, struct bio_list *bl2) -{ - if (!bl2->head) - return; - - if (bl->tail) - bl->tail->bi_next = bl2->head; - else - bl->head = bl2->head; - - bl->tail = bl2->tail; -} - -static inline struct bio *bio_list_pop(struct bio_list *bl) -{ - struct bio *bio = bl->head; - - if (bio) { - bl->head = bl->head->bi_next; - if (!bl->head) - bl->tail = NULL; - - bio->bi_next = NULL; - } - - return bio; -} - -static inline struct bio *bio_list_get(struct bio_list *bl) -{ - struct bio *bio = bl->head; - - bl->head = bl->tail = NULL; - - return bio; -} - -#endif diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index f72a82f..c6e206f 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -8,9 +8,9 @@ #include "dm.h" #include "dm-path-selector.h" #include "dm-hw-handler.h" -#include "dm-bio-list.h" #include "dm-bio-record.h" +#include <linux/bio-list.h> #include <linux/ctype.h> #include <linux/init.h> #include <linux/mempool.h> diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 6cfa8d4..53f589b 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -5,11 +5,11 @@ */ #include "dm.h" -#include "dm-bio-list.h" #include "dm-io.h" #include "dm-log.h" #include "kcopyd.h" +#include <linux/bio-list.h> #include <linux/ctype.h> #include <linux/init.h> #include <linux/mempool.h> diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index f3759dd..2e65db8 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -18,9 +18,9 @@ #include <linux/module.h> #include <linux/slab.h> #include <linux/vmalloc.h> +#include <linux/bio-list.h> #include "dm-snap.h" -#include "dm-bio-list.h" #include "kcopyd.h" /* diff --git a/drivers/md/dm.c b/drivers/md/dm.c index e9adeb9..020f415 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -6,8 +6,8 @@ */ #include "dm.h" -#include "dm-bio-list.h" +#include <linux/bio-list.h> #include <linux/init.h> #include <linux/module.h> #include <linux/moduleparam.h> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d39f584..4e43ce2 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -31,7 +31,7 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "dm-bio-list.h" +#include <linux/bio-list.h> #include <linux/raid/raid1.h> #include <linux/raid/bitmap.h> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index ab90a6d..3ced1b9 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -18,7 +18,7 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include "dm-bio-list.h" +#include <linux/bio-list.h> #include <linux/raid/raid10.h> #include <linux/raid/bitmap.h> diff --git a/include/linux/bio-list.h b/include/linux/bio-list.h new file mode 100644 index 0000000..4653516 --- /dev/null +++ b/include/linux/bio-list.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2004 Red Hat UK Ltd. + * + * This file is released under the GPL. + */ + +#ifndef _BIO_LIST_H +#define _BIO_LIST_H + +#include <linux/bio.h> + +struct bio_list { + struct bio *head; + struct bio *tail; +}; + +static inline void bio_list_init(struct bio_list *bl) +{ + bl->head = bl->tail = NULL; +} + +static inline void bio_list_add(struct bio_list *bl, struct bio *bio) +{ + bio->bi_next = NULL; + + if (bl->tail) + bl->tail->bi_next = bio; + else + bl->head = bio; + + bl->tail = bio; +} + +static inline void bio_list_merge(struct bio_list *bl, struct bio_list *bl2) +{ + if (!bl2->head) + return; + + if (bl->tail) + bl->tail->bi_next = bl2->head; + else + bl->head = bl2->head; + + bl->tail = bl2->tail; +} + +static inline struct bio *bio_list_pop(struct bio_list *bl) +{ + struct bio *bio = bl->head; + + if (bio) { + bl->head = bl->head->bi_next; + if (!bl->head) + bl->tail = NULL; + + bio->bi_next = NULL; + } + + return bio; +} + +static inline struct bio *bio_list_get(struct bio_list *bl) +{ + struct bio *bio = bl->head; + + bl->head = bl->tail = NULL; + + return bio; +} + +#endif diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 617b950..2323360 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -15,8 +15,7 @@ #ifndef _MD_K_H #define _MD_K_H -/* and dm-bio-list.h is not under include/linux because.... ??? */ -#include "../../../drivers/md/dm-bio-list.h" +#include <linux/bio-list.h> #define LEVEL_MULTIPATH (-4) #define LEVEL_LINEAR (-1) -- 1.1.3 - : send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html