예제 #1
0
void devfs_add_partitioned(struct gendisk *disk)
{
	char dirname[64], symlink[16];

	devfs_mk_dir(disk->devfs_name);
	devfs_mk_bdev(MKDEV(disk->major, disk->first_minor),
			S_IFBLK|S_IRUSR|S_IWUSR,
			"%s/disc", disk->devfs_name);

	disk->number = alloc_unique_number(&disc_numspace);

	sprintf(symlink, "discs/disc%d", disk->number);
	sprintf(dirname, "../%s", disk->devfs_name);
	devfs_mk_symlink(symlink, dirname);

}
예제 #2
0
파일: devfs.c 프로젝트: OpenHMR/Open-HMR600
void devfs_add_disk(struct gendisk *disk)
{
	devfs_mk_bdev(MKDEV(disk->major, disk->first_minor),
			(disk->flags & GENHD_FL_CD) ?
				S_IFBLK|S_IRUGO|S_IWUGO :
				S_IFBLK|S_IRUSR|S_IWUSR,
			"%s", disk->devfs_name);

	if (disk->flags & GENHD_FL_CD) {
		char dirname[64], symlink[16];

		disk->number = alloc_unique_number(&cdrom_numspace);

		sprintf(symlink, "cdroms/cdrom%d", disk->number);
		sprintf(dirname, "../%s", disk->devfs_name);
		devfs_mk_symlink(symlink, dirname);
	}
}