Skip to contentSkip to conversation

add sysfs class support for raw devices [06/10]]

PATCH New Jeff Garzik 1 participant 1 message Jan 15, 2004

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add sysfs class support for raw devices [06/10]]

Regarding the recent discussion on bonding/vlan/bridge/blah configuration...

This adds class/raw/ support for all raw devices. It also provides a symlink to the block device that the raw device is mapped to. For example:

$ tree /sys/class/raw/
/sys/class/raw/
|-- raw1
|   |-- dev
|   `-- device -> ../../../block/sda
|-- raw2
|   |-- dev
|   `-- device -> ../../../block/sda/sda2
`-- rawctl
    `-- dev

Note, in order to get that symlink, I had to export get_gendisk() so that modules can use it. I hope this is ok with everyone.

This is based on a patch originally written by
Leann Ogasawara <[email protected]>

drivers/block/genhd.c +2 -0
diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c
@@ -224,6 +224,8 @@
 	return  kobj ? to_disk(kobj) : NULL;
 }
 
+EXPORT_SYMBOL(get_gendisk);
+
 #ifdef CONFIG_PROC_FS
 /* iterator */
 static void *part_start(struct seq_file *part, loff_t *pos)
drivers/char/raw.c +40 -1

82 lines not on this page · raw message

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/