Skip to contentSkip to conversation

block: add 'struct gendisk' declaration

PATCH New Arnd Bergmann 1 participant 1 message May 29, 2020 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: add 'struct gendisk' declaration

The added disk_start_io_acct() function declaration causes a warning when CONFIG_BLOCK is disabled:

include/linux/blkdev.h:1895:41: error: declaration of 'struct gendisk' will not be visible outside of this function [-Werror,-Wvisibility]

Declare the struct tag before the function to suppress that warning.

Fixes 956d510ee78c ("block: add disk/bio-based accounting helpers")
---
 include/linux/blkdev.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/blkdev.h +1 -0
index 36568c9d030a..96cf7af86b73 100644
@@ -1892,6 +1892,7 @@ static inline void blk_wake_io_task(struct task_struct *waiter)
 		wake_up_process(waiter);
 }
 
+struct gendisk;
 unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
 		unsigned int op);
 void disk_end_io_acct(struct gendisk *disk, unsigned int op,
Signature · 1 line
2.26.2