Skip to contentSkip to conversation

dm: bio_list macro renaming

PATCH In review Alasdair G Kergon 2 participants 2 messages Jul 11, 2007 Device mapper

lore
Share & tools
lore

Alasdair G Kergon

author maintainer
#0 lore raw

PATCH 1/18 dm: bio_list macro renaming

From: Alasdair G Kergon <[email protected]>

Rename BIO_LIST() macro to DEFINE_BIO_LIST(), named similarly to DEFINE_SPINLOCK().

---
 drivers/md/dm-bio-list.h |    2 +-
 drivers/md/dm-delay.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-bio-list.h +1 -1
Index: linux/drivers/md/dm-bio-list.h
===================================================================
@@ -22,7 +22,7 @@ static inline int bio_list_empty(const s
 
 #define BIO_LIST_INIT { .head = NULL, .tail = NULL }
 
-#define BIO_LIST(bl) \
+#define DEFINE_BIO_LIST(bl) \
 	struct bio_list bl = BIO_LIST_INIT
 
 static inline void bio_list_init(struct bio_list *bl)
drivers/md/dm-delay.c +1 -1
Index: linux/drivers/md/dm-delay.c
===================================================================
@@ -83,7 +83,7 @@ static struct bio *flush_delayed_bios(st
 	struct delay_info *delayed, *next;
 	unsigned long next_expires = 0;
 	int start_timer = 0;
-	BIO_LIST(flush_bios);
+	DEFINE_BIO_LIST(flush_bios);
 
 	mutex_lock(&delayed_bios_lock);
 	list_for_each_entry_safe(delayed, next, &dc->delayed_bios, list) {
#1 lore raw
Quoted 31 lines · On Wed, 11 Jul 2007 21:56:35 +0100 Alasdair G Kergon <[email protected]> wrote:

From: Alasdair G Kergon <[email protected]>

Rename BIO_LIST() macro to DEFINE_BIO_LIST(), named similarly to DEFINE_SPINLOCK().

---
 drivers/md/dm-bio-list.h |    2 +-
 drivers/md/dm-delay.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Index: linux/drivers/md/dm-bio-list.h
===================================================================

drivers/md/dm-bio-list.h +1 -1
@@ -22,7 +22,7 @@ static inline int bio_list_empty(const s
 
 #define BIO_LIST_INIT { .head = NULL, .tail = NULL }
 
-#define BIO_LIST(bl) \
+#define DEFINE_BIO_LIST(bl) \
 	struct bio_list bl = BIO_LIST_INIT
 
 static inline void bio_list_init(struct bio_list *bl)

Index: linux/drivers/md/dm-delay.c
===================================================================

drivers/md/dm-delay.c static struct bio *flush_delayed_bios(st · line 89

Quoted 8 lines
drivers/md/dm-delay.c +1 -1
@@ -83,7 +83,7 @@ static struct bio *flush_delayed_bios(st
 	struct delay_info *delayed, *next;
 	unsigned long next_expires = 0;
 	int start_timer = 0;
-	BIO_LIST(flush_bios);
+	DEFINE_BIO_LIST(flush_bios);
 
 	mutex_lock(&delayed_bios_lock);
 	list_for_each_entry_safe(delayed, next, &dc->delayed_bios, list) {

As there is only one caller, why not remove the unpleasant-looking BIO_LIST and DEFINE_BIO_LIST altogether and just do

	struct bio_list flush_bios = { };

at that single callsite?