Thread (11 messages) 11 messages, 4 authors, 2020-11-30

Re: [PATCH 1/4] block: add a hard-readonly flag to struct gendisk

From: Alex Elder <hidden>
Date: 2020-11-30 01:24:31
Also in: ceph-devel, dm-devel, linux-nvme

On 11/29/20 12:19 PM, Christoph Hellwig wrote:
Commit 20bd1d026aac ("scsi: sd: Keep disk read-only when re-reading
partition") addressed a long-standing problem with user read-only
Little nit I noticed below.	-Alex

. . .
quoted hunk ↗ jump to hunk
diff --git a/block/genhd.c b/block/genhd.c
index 565cf36a5f1864..5e746223b6fa0f 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1625,31 +1625,35 @@ static void set_disk_ro_uevent(struct gendisk *gd, int ro)
 	kobject_uevent_env(&disk_to_dev(gd)->kobj, KOBJ_CHANGE, envp);
 }
 
-void set_disk_ro(struct gendisk *disk, int flag)
+/**
+ * set_disk_ro - set a gendisk read-only
+ * @disk:	The disk device
+ * @state:	true or false
s/state/read_only/
+ *
+ * This function is used to indicate whether a given disk device should have its
+ * read-only flag set. set_disk_ro() is typically used by device drivers to
+ * indicate whether the underlying physical device is write-protected.
+ */
+void set_disk_ro(struct gendisk *disk, bool read_only)
. . .

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help