Skip to contentSkip to conversation

remove IDESCSI_SG_TRANSFORM (compile fix)

RFC In review Christoph Hellwig 3 participants 4 messages Nov 29, 2002 – Dec 2, 2002 SCSI

lore
Share & tools
lore
#0 lore raw

RFC 1/1 remove IDESCSI_SG_TRANSFORM (compile fix)

In the current 2.5 scsi-misc tree Scsi_Device_Template.tag is gone.

ide-scsi is still using it in should_transform() to decide whether to test IDESCSI_SG_TRANSFORM or IDESCSI_TRANSFORM.

The obvious compile fix is to just kill that check, which makes IDESCSI_SG_TRANSFORM superflous. Of course the question remains what the actual point of IDESCSI_SG_TRANSFORM was and if we still need it.

drivers/scsi/ide-scsi.c +0 -25
@@ -82,7 +82,6 @@
  *	SCSI command transformation layer
  */
 #define IDESCSI_TRANSFORM		0	/* Enable/Disable transformation */
-#define IDESCSI_SG_TRANSFORM		1	/* /dev/sg transformation */
 
 /*
  *	Log flags
@@ -532,7 +531,6 @@
 	if (drive->id && (drive->id->config & 0x0060) == 0x20)
 		set_bit (IDESCSI_DRQ_INTERRUPT, &scsi->flags);
 	set_bit(IDESCSI_TRANSFORM, &scsi->transform);
-	clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
 #if IDESCSI_DEBUG_LOG
 	set_bit(IDESCSI_LOG_CMD, &scsi->log);
 #endif /* IDESCSI_DEBUG_LOG */
@@ -666,22 +664,6 @@
 	return "SCSI host adapter emulation for IDE ATAPI devices";
 }
 
-int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg)
-{
-	ide_drive_t *drive = idescsi_drives[dev->id];
-	idescsi_scsi_t *scsi = drive->driver_data;
-
-	if (cmd == SG_SET_TRANSFORM) {
-		if (arg)
-			set_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
-		else
-			clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
-		return 0;
-	} else if (cmd == SG_GET_TRANSFORM)
-		return put_user(test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform), (int *) arg);
-	return -EINVAL;
-}
-
 static inline struct bio *idescsi_kmalloc_bio (int count)
 {
 	struct bio *bh, *bhp, *first_bh;
@@ -760,13 +742,7 @@
 static inline int should_transform(ide_drive_t *drive, Scsi_Cmnd *cmd)
 {
 	idescsi_scsi_t *scsi = drive->driver_data;
-	struct gendisk *disk = cmd->request->rq_disk;
 
-	if (disk) {
-		struct Scsi_Device_Template **p = disk->private_data;
-		if (strcmp((*p)->tag, "sg") == 0)
-			return test_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
-	}
 	return test_bit(IDESCSI_TRANSFORM, &scsi->transform);
 }
 
@@ -864,7 +840,6 @@
 	.detect		= idescsi_detect,
 	.release	= idescsi_release,
 	.info		= idescsi_info,
-	.ioctl		= idescsi_ioctl,
 	.queuecommand	= idescsi_queue,
 	.bios_param	= idescsi_bios,
 	.can_queue	= 10,
#1 lore raw
Quoted 9 lines · Christoph Hellwig [[email protected]] wrote:

In the current 2.5 scsi-misc tree Scsi_Device_Template.tag is gone.

ide-scsi is still using it in should_transform() to decide whether to test IDESCSI_SG_TRANSFORM or IDESCSI_TRANSFORM.

The obvious compile fix is to just kill that check, which makes IDESCSI_SG_TRANSFORM superflous. Of course the question remains what the actual point of IDESCSI_SG_TRANSFORM was and if we still need it.

Thanks for catching this Christoph I thought the only use was inside SCSI. I could make a patch to scsi-misc to add tag back in. Another option if it is still needed is to switch to "->name == "generic").

Though I have not used this interface I thought if one was using an sg device to a ide-scsi device and the flag was set that sg commands that where not 100% the same as ATAP commands where translated.

-andmike
--
Michael Anderson
[email protected]

#2 lore raw
Quoted 7 lines · Mike Anderson

Thanks for catching this Christoph I thought the only use was inside SCSI. I could make a patch to scsi-misc to add tag back in. Another option if it is still needed is to switch to "->name == "generic").

Though I have not used this interface I thought if one was using an sg device to a ide-scsi device and the flag was set that sg commands that where not 100% the same as ATAP commands where translated.

Well, imho IDESCSI_SG_TRANSFORM is broken in 2.5. Now that ever block driver implements the sg ioctls a sg request can come from sd or sr aswell.

#3 lore raw
Quoted 5 lines · Christoph Hellwig
Quoted 4 lines · Mike Anderson

Thanks for catching this Christoph I thought the only use was inside SCSI. I could make a patch to scsi-misc to add tag back in. Another option if it is still needed is to switch to "->name == "generic").

Quoted 7 lines
Quoted 3 lines

Though I have not used this interface I thought if one was using an sg device to a ide-scsi device and the flag was set that sg commands that where not 100% the same as ATAP commands where translated.

Well, imho IDESCSI_SG_TRANSFORM is broken in 2.5. Now that ever block driver implements the sg ioctls a sg request can come from sd or sr aswell.

Quite possibly, but newer drivers that might used sd/sr via the new API's should also know about the newer standards. Older sg users are not always so bright.