Lines Matching refs:sd_gendisks
93 static struct gendisk *sd_gendisks; variable
202 put_user(sd_gendisks[SD_MAJOR_IDX( in sd_ioctl()
235 put_user(sd_gendisks[SD_MAJOR_IDX( in sd_ioctl()
304 ppnt = &sd_gendisks[SD_MAJOR_IDX(SCpnt->request.rq_dev)].part[MINOR(SCpnt->request.rq_dev)]; in sd_init_command()
589 #define SD_GENDISK(i) sd_gendisks[(i) / SCSI_DISKS_PER_MAJOR]
657 error_sector -= sd_gendisks[SD_MAJOR_IDX( in rw_intr()
1196 sd_gendisks = kmalloc(N_USED_SD_MAJORS * sizeof(struct gendisk), GFP_ATOMIC); in sd_init()
1197 if (!sd_gendisks) in sd_init()
1200 sd_gendisks[i] = sd_gendisk; /* memcpy */ in sd_init()
1201 sd_gendisks[i].de_arr = kmalloc (SCSI_DISKS_PER_MAJOR * sizeof *sd_gendisks[i].de_arr, in sd_init()
1203 if (!sd_gendisks[i].de_arr) in sd_init()
1205 memset (sd_gendisks[i].de_arr, 0, in sd_init()
1206 SCSI_DISKS_PER_MAJOR * sizeof *sd_gendisks[i].de_arr); in sd_init()
1207 sd_gendisks[i].flags = kmalloc (SCSI_DISKS_PER_MAJOR * sizeof *sd_gendisks[i].flags, in sd_init()
1209 if (!sd_gendisks[i].flags) in sd_init()
1211 memset (sd_gendisks[i].flags, 0, in sd_init()
1212 SCSI_DISKS_PER_MAJOR * sizeof *sd_gendisks[i].flags); in sd_init()
1213 sd_gendisks[i].major = SD_MAJOR(i); in sd_init()
1214 sd_gendisks[i].major_name = "sd"; in sd_init()
1215 sd_gendisks[i].minor_shift = 4; in sd_init()
1216 sd_gendisks[i].max_p = 1 << 4; in sd_init()
1217 sd_gendisks[i].part = kmalloc((SCSI_DISKS_PER_MAJOR << 4) * sizeof(struct hd_struct), in sd_init()
1219 if (!sd_gendisks[i].part) in sd_init()
1221 memset(sd_gendisks[i].part, 0, (SCSI_DISKS_PER_MAJOR << 4) * sizeof(struct hd_struct)); in sd_init()
1222 sd_gendisks[i].sizes = sd_sizes + (i * SCSI_DISKS_PER_MAJOR << 4); in sd_init()
1223 sd_gendisks[i].nr_real = SCSI_DISKS_PER_MAJOR; in sd_init()
1224 sd_gendisks[i].real_devices = in sd_init()
1231 kfree(sd_gendisks[i].flags); in sd_init()
1233 kfree(sd_gendisks[i].de_arr); in sd_init()
1236 kfree(sd_gendisks[i].de_arr); in sd_init()
1237 kfree(sd_gendisks[i].flags); in sd_init()
1238 kfree(sd_gendisks[i].part); in sd_init()
1240 kfree(sd_gendisks); in sd_init()
1241 sd_gendisks = NULL; in sd_init()
1269 add_gendisk(&sd_gendisks[i]); in sd_finish()
1477 kfree(sd_gendisks[i].de_arr); in exit_sd()
1478 kfree(sd_gendisks[i].flags); in exit_sd()
1479 kfree(sd_gendisks[i].part); in exit_sd()
1483 del_gendisk(&sd_gendisks[i]); in exit_sd()
1490 if (sd_gendisks != NULL) /* kfree tests for 0, but leave explicit */ in exit_sd()
1491 kfree(sd_gendisks); in exit_sd()