summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-10-29 15:58:28 +0100
committerJens Axboe <axboe@kernel.dk>2020-11-16 08:14:30 -0700
commita160c6159d4a0cf82f28bc1658a958e278ec3688 (patch)
tree2026376f6fe335c63633b974f34e6826e81f4e3e /include
parentbd8eff3ba2caca53ea72cf3cc87a7797771dd7d2 (diff)
downloadlinux-a160c6159d4a0cf82f28bc1658a958e278ec3688.tar.bz2
block: add an optional probe callback to major_names
Add a callback to the major_names array that allows a driver to override how to probe for dev_t that doesn't currently have a gendisk registered. This will help separating the lookup of the gendisk by dev_t vs probe action for a not currently registered dev_t. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/genhd.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 52eb592c874a..811d0f83c4cf 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -367,7 +367,10 @@ extern void blk_unregister_region(dev_t devt, unsigned long range);
#define alloc_disk(minors) alloc_disk_node(minors, NUMA_NO_NODE)
-int register_blkdev(unsigned int major, const char *name);
+int __register_blkdev(unsigned int major, const char *name,
+ void (*probe)(dev_t devt));
+#define register_blkdev(major, name) \
+ __register_blkdev(major, name, NULL)
void unregister_blkdev(unsigned int major, const char *name);
void revalidate_disk_size(struct gendisk *disk, bool verbose);