+/**
+ * This function convert the major and minor number to the corresponding disk.
+ * Data taken from Documentation/devices.txt of the kernel tree.
+ */
+static char * major_minor_to_diskname( lttv_block* disk_data)
+{
+ switch(disk_data->major_number)
+ {
+ /* IDE Disks */
+ case 3: /* First MFM, RLL and IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hda";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdb";
+ break;
+
+ case 22: /*Second IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hdc";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdd";
+ break;
+
+ case 33: /* Third IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hde";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdf";
+ break;
+
+ case 34: /* Fourth IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hdg";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdh";
+ break;
+
+ case 56: /* Fifth IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hdi";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdj";
+ break;
+
+ case 57: /* Sixth IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hdk";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdl";
+ break;
+
+ case 88: /* Seventh IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hdm";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdn";
+ break;
+
+ case 89: /* Eighth IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hdo";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdp";
+ break;
+
+ case 90: /* Ninth IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hdq";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdr";
+ break;
+
+ case 91: /* Tenth IDE hard disk/CD-ROM interface */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 64))
+ return "/dev/hds";
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 128))
+ return "/dev/hdt";
+ break;
+
+ /* SCSI Disks */
+ case 8: /* SCSI disk devices */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
+ return "/dev/sda"; // First SCSI disk whole disk
+
+ if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
+ return "/dev/sdb";// Second SCSI disk whole disk
+
+ if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
+ return "/dev/sdc";// Third SCSI disk whole disk
+
+ if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
+ return "/dev/sdd";// Fourth SCSI disk whole disk
+
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
+ return "/dev/sde";// Fifth SCSI disk whole disk
+
+ if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
+ return "/dev/sdf";// Sixth SCSI disk whole disk
+
+ if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
+ return "/dev/sdg";// seventh SCSI disk whole disk
+
+ if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
+ return "/dev/sdh";// eighth SCSI disk whole disk
+
+ if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
+ return "/dev/sdi";// 9th SCSI disk whole disk
+
+ if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
+ return "/dev/sdj";// 10th SCSI disk whole disk
+
+ if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
+ return "/dev/sdk";// 11th SCSI disk whole disk
+
+ if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
+ return "/dev/sdl";// 12th SCSI disk whole disk
+
+ if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
+ return "/dev/sdm";// 13th SCSI disk whole disk
+
+ if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
+ return "/dev/sdn";// 14th SCSI disk whole disk
+
+ if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
+ return "/dev/sdo";// 15th SCSI disk whole disk
+
+ if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
+ return "/dev/sdp";// 16th SCSI disk whole disk
+ break;
+
+ case 65: /* SCSI disk devices */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
+ return "/dev/sdq";
+
+ if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
+ return "/dev/sdr";
+
+ if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
+ return "/dev/sds";
+
+ if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
+ return "/dev/sdt";
+
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
+ return "/dev/sdu";
+
+ if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
+ return "/dev/sdv";
+
+ if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
+ return "/dev/sdw";
+
+ if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
+ return "/dev/sdy";
+
+ if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
+ return "/dev/sdx";
+
+ if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
+ return "/dev/sdz";
+
+ if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
+ return "/dev/sdaa";
+
+ if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
+ return "/dev/sdab";
+
+ if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
+ return "/dev/sdac";
+
+ if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
+ return "/dev/sdad";
+
+ if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
+ return "/dev/sdae";
+
+ if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
+ return "/dev/sdaf";
+ break;
+
+ case 66: /* SCSI disk devices */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
+ return "/dev/sdag";
+
+ if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
+ return "/dev/sdah";
+
+ if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
+ return "/dev/sdai";
+
+ if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
+ return "/dev/sdaj";
+
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
+ return "/dev/sdak";
+
+ if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
+ return "/dev/sdal";
+
+ if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
+ return "/dev/sdam";
+
+ if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
+ return "/dev/sdan";
+
+ if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
+ return "/dev/sdao";
+
+ if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
+ return "/dev/sdap";
+
+ if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
+ return "/dev/sdaq";
+
+ if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
+ return "/dev/sdar";
+
+ if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
+ return "/dev/sdas";
+
+ if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
+ return "/dev/sdat";
+
+ if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
+ return "/dev/sdau";
+
+ if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
+ return "/dev/sdav";
+ break;
+
+
+ case 67: /* SCSI disk devices */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
+ return "/dev/sdaw";
+
+ if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
+ return "/dev/sdax";
+
+ if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
+ return "/dev/sday";
+
+ if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
+ return "/dev/sdaz";
+
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
+ return "/dev/sdba";
+
+ if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
+ return "/dev/sdbb";
+
+ if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
+ return "/dev/sdbc";
+
+ if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
+ return "/dev/sdbd";
+
+ if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
+ return "/dev/sdbe";
+
+ if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
+ return "/dev/sdbf";
+
+ if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
+ return "/dev/sdbg";
+
+ if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
+ return "/dev/sdbh";
+
+ if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
+ return "/dev/sdbi";
+
+ if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
+ return "/dev/sdbj";
+
+ if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
+ return "/dev/sdbk";
+
+ if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
+ return "/dev/sdbl";
+ break;
+
+ case 68 : /* SCSI disk devices */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
+ return "/dev/sdbm";
+
+ if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
+ return "/dev/sdbm";
+
+ if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
+ return "/dev/sdbo";
+
+ if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
+ return "/dev/sdbp";
+
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
+ return "/dev/sdbq";
+
+ if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
+ return "/dev/sdbr";
+
+ if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
+ return "/dev/sdbs";
+
+ if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
+ return "/dev/sdbt";
+
+ if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
+ return "/dev/sdbu";
+
+ if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
+ return "/dev/sdbv";
+
+ if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
+ return "/dev/sdbw";
+
+ if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
+ return "/dev/sdbx";
+
+ if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
+ return "/dev/sdby";
+
+ if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
+ return "/dev/sdbz";
+
+ if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
+ return "/dev/sdca";
+
+ if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
+ return "/dev/sdcb";
+ break;
+ case 69 : /* SCSI disk devices */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
+ return "/dev/sdcc";
+
+ if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
+ return "/dev/sdcd";
+
+ if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
+ return "/dev/sdce";
+
+ if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
+ return "/dev/sdcf";
+
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
+ return "/dev/sdcg";
+
+ if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
+ return "/dev/sdch";
+
+ if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
+ return "/dev/sdci";
+
+ if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
+ return "/dev/sdcj";
+
+ if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
+ return "/dev/sdck";
+
+ if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
+ return "/dev/sdcl";
+
+ if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
+ return "/dev/sdcm";
+
+ if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
+ return "/dev/sdcn";
+
+ if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
+ return "/dev/sdco";
+
+ if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
+ return "/dev/sdcp";
+
+ if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
+ return "/dev/sdcq";
+
+ if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
+ return "/dev/sdcr";
+ break;
+
+
+ case 70 : /* SCSI disk devices */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
+ return "/dev/sdcs";
+
+ if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
+ return "/dev/sdct";
+
+ if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
+ return "/dev/sdcu";
+
+ if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
+ return "/dev/sdcv";
+
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
+ return "/dev/sdcw";
+
+ if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
+ return "/dev/sdcx";
+
+ if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
+ return "/dev/sdcy";
+
+ if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
+ return "/dev/sdcz";
+
+ if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
+ return "/dev/sdda";
+
+ if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
+ return "/dev/sddb";
+
+ if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
+ return "/dev/sddc";
+
+ if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
+ return "/dev/sddd";
+
+ if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
+ return "/dev/sdde";
+
+ if((disk_data->minor_number >= 208) && (disk_data->minor_number < 224))
+ return "/dev/sddf";
+
+ if((disk_data->minor_number >= 224) && (disk_data->minor_number < 240))
+ return "/dev/sddg";
+
+ if((disk_data->minor_number >= 240) && (disk_data->minor_number < 256))
+ return "/dev/sddh";
+ break;
+
+ case 71: /* SCSI disk devices */
+ if( (disk_data->minor_number >= 0) && (disk_data->minor_number < 16))
+ return "/dev/sddi";
+
+ if((disk_data->minor_number >= 16) && (disk_data->minor_number < 32))
+ return "/dev/sddj";
+
+ if((disk_data->minor_number >= 32) && (disk_data->minor_number < 48))
+ return "/dev/sddk";
+
+ if((disk_data->minor_number >= 48) && (disk_data->minor_number < 64))
+ return "/dev/sddl";
+
+ if((disk_data->minor_number >= 64) && (disk_data->minor_number < 80))
+ return "/dev/sddm";
+
+ if((disk_data->minor_number >= 80) && (disk_data->minor_number < 96))
+ return "/dev/sddn";
+
+ if((disk_data->minor_number >= 96) && (disk_data->minor_number < 112))
+ return "/dev/sddo";
+
+ if((disk_data->minor_number >= 112) && (disk_data->minor_number < 128))
+ return "/dev/sddp";
+
+ if((disk_data->minor_number >= 128) && (disk_data->minor_number < 144))
+ return "/dev/sddq";
+
+ if((disk_data->minor_number >= 144) && (disk_data->minor_number < 160))
+ return "/dev/sddr";
+
+ if((disk_data->minor_number >= 160) && (disk_data->minor_number < 176))
+ return "/dev/sdds";
+
+ if((disk_data->minor_number >= 176) && (disk_data->minor_number < 192))
+ return "/dev/sddt";
+
+ if((disk_data->minor_number >= 192) && (disk_data->minor_number < 208))
+ return "/dev/sddu";