summaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-28 07:30:32 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-28 07:30:32 +0100
commit085686fb8491a7cbf6a7260d5b9d4169a041c340 (patch)
tree6b35dea52e658376f67d0a4e0cb511e0589602ea /block/genhd.c
parent2be483f12ea34b43826f70c60f0924a7bda991bd (diff)
parent7e57714cd0ad2d5bb90e50b5096a0e671dec1ef3 (diff)
downloadlinux-085686fb8491a7cbf6a7260d5b9d4169a041c340.tar.bz2
Merge 5.17-rc6 into char-misc-next
We need the char-misc fixes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 626c8406f21a..9eca1f7d35c9 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -549,6 +549,20 @@ out_free_ext_minor:
EXPORT_SYMBOL(device_add_disk);
/**
+ * blk_mark_disk_dead - mark a disk as dead
+ * @disk: disk to mark as dead
+ *
+ * Mark as disk as dead (e.g. surprise removed) and don't accept any new I/O
+ * to this disk.
+ */
+void blk_mark_disk_dead(struct gendisk *disk)
+{
+ set_bit(GD_DEAD, &disk->state);
+ blk_queue_start_drain(disk->queue);
+}
+EXPORT_SYMBOL_GPL(blk_mark_disk_dead);
+
+/**
* del_gendisk - remove the gendisk
* @disk: the struct gendisk to remove
*