Skip to content

Commit cb2ffb2

Browse files
tegMiklos Szeredi
authored andcommitted
cuse: add fix minor number to /dev/cuse
This allows udev (or more recently systemd-tmpfiles) to create /dev/cuse on boot, in the same way as /dev/fuse is currently created, and the corresponding module to be loaded on first access. The corresponding functionalty was introduced for fuse in commit 578454f. Signed-off-by: Tom Gundersen <teg@jklm.no> Cc: Kay Sievers <kay@vrfy.org> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
1 parent ff17be0 commit cb2ffb2

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎Documentation/devices.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ Your cooperation is appreciated.
414414
200 = /dev/net/tun TAP/TUN network device
415415
201 = /dev/button/gulpb Transmeta GULP-B buttons
416416
202 = /dev/emd/ctl Enhanced Metadisk RAID (EMD) control
417+
203 = /dev/cuse Cuse (character device in user-space)
417418
204 = /dev/video/em8300 EM8300 DVD decoder control
418419
205 = /dev/video/em8300_mv EM8300 DVD decoder video
419420
206 = /dev/video/em8300_ma EM8300 DVD decoder audio

‎fs/fuse/cuse.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,11 +589,14 @@ static struct attribute *cuse_class_dev_attrs[] = {
589589
ATTRIBUTE_GROUPS(cuse_class_dev);
590590

591591
static struct miscdevice cuse_miscdev = {
592-
.minor = MISC_DYNAMIC_MINOR,
592+
.minor = CUSE_MINOR,
593593
.name = "cuse",
594594
.fops = &cuse_channel_fops,
595595
};
596596

597+
MODULE_ALIAS_MISCDEV(CUSE_MINOR);
598+
MODULE_ALIAS("devname:cuse");
599+
597600
static int __init cuse_init(void)
598601
{
599602
int i, rc;

‎include/linux/miscdevice.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#define I2O_MINOR 166
3232
#define MICROCODE_MINOR 184
3333
#define TUN_MINOR 200
34+
#define CUSE_MINOR 203
3435
#define MWAVE_MINOR 219 /* ACP/Mwave Modem */
3536
#define MPT_MINOR 220
3637
#define MPT2SAS_MINOR 221

0 commit comments

Comments
 (0)