Skip to contentSkip to conversation

fix rq->flags use in ide-tape.c

PATCH Jens Axboe 3 participants 10 messages Nov 5, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jens Axboe

author
#1 lore raw
Quoted 5 lines · Linux Kernel Mailing List

ChangeSet 1.1413, 2003/11/04 08:01:30-08:00, [email protected]

	[PATCH] fix rq->flags use in ide-tape.c
	
	Noticed by [email protected]:

Guys, this is _way_ ugly. We definitely dont need more crap in ->flags for private driver use, stuff them somewhere else in the rq. rq->cmd[0] usage would be a whole lot better. This patch should never have been merged. If each and every driver needs 5 private bits in ->flags, well...

Was this even posted on linux-kernel for review?

Quoted 9 lines
(quoted diff) +5 -0
@@ -218,6 +223,11 @@
 #define REQ_PM_SUSPEND	(1 << __REQ_PM_SUSPEND)
 #define REQ_PM_RESUME	(1 << __REQ_PM_RESUME)
 #define REQ_PM_SHUTDOWN	(1 << __REQ_PM_SHUTDOWN)
+#define REQ_IDETAPE_PC1 (1 << __REQ_IDETAPE_PC1)
+#define REQ_IDETAPE_PC2 (1 << __REQ_IDETAPE_PC2)
+#define REQ_IDETAPE_READ	(1 << __REQ_IDETAPE_READ)
+#define REQ_IDETAPE_WRITE	(1 << __REQ_IDETAPE_WRITE)
+#define REQ_IDETAPE_READ_BUFFER	(1 << __REQ_IDETAPE_READ_BUFFER)
Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Linux Kernel Mailing List

ChangeSet 1.1413, 2003/11/04 08:01:30-08:00,
[email protected]

	[PATCH] fix rq->flags use in ide-tape.c
Quoted 7 lines
Quoted 1 line

Noticed by [email protected]:

Guys, this is _way_ ugly. We definitely dont need more crap in ->flags for private driver use, stuff them somewhere else in the rq. rq->cmd[0] usage would be a whole lot better. This patch should never have been merged. If each and every driver needs 5 private bits in ->flags, well...

Yeah, it is ugly. Using rq->cmd is also ugly as it hides the problem in ide-tape.c, but if you prefer this way I can clean it up. I just wanted minimal changes to ide-tape.c to make it working.

Quoted 1 line

Was this even posted on linux-kernel for review?

Yes.

--bartlomiej

Quoted 9 lines
Quoted 9 lines
(quoted diff) +5 -0
@@ -218,6 +223,11 @@
 #define REQ_PM_SUSPEND	(1 << __REQ_PM_SUSPEND)
 #define REQ_PM_RESUME	(1 << __REQ_PM_RESUME)
 #define REQ_PM_SHUTDOWN	(1 << __REQ_PM_SHUTDOWN)
+#define REQ_IDETAPE_PC1 (1 << __REQ_IDETAPE_PC1)
+#define REQ_IDETAPE_PC2 (1 << __REQ_IDETAPE_PC2)
+#define REQ_IDETAPE_READ	(1 << __REQ_IDETAPE_READ)
+#define REQ_IDETAPE_WRITE	(1 << __REQ_IDETAPE_WRITE)
+#define REQ_IDETAPE_READ_BUFFER	(1 << __REQ_IDETAPE_READ_BUFFER)
#3 lore raw
Quoted 4 lines

Yeah, it is ugly. Using rq->cmd is also ugly as it hides the problem in ide-tape.c, but if you prefer this way I can clean it up. I just wanted minimal changes to ide-tape.c to make it working.

isn't the right answer "use ide-scsi and scsi-tape" for IDE based tape drives ?

#4 lore raw
Quoted 6 lines · Arjan van de Ven
Quoted 3 lines

Yeah, it is ugly. Using rq->cmd is also ugly as it hides the problem in ide-tape.c, but if you prefer this way I can clean it up. I just wanted minimal changes to ide-tape.c to make it working.

isn't the right answer "use ide-scsi and scsi-tape" for IDE based tape drives ?

NO!!!

author
#5 lore raw
In reply to Arjan van de Ven
Quoted 7 lines · Arjan van de Ven
Quoted 4 lines

Yeah, it is ugly. Using rq->cmd is also ugly as it hides the problem in ide-tape.c, but if you prefer this way I can clean it up. I just wanted minimal changes to ide-tape.c to make it working.

isn't the right answer "use ide-scsi and scsi-tape" for IDE based tape drives ?

No comment :0

Signature · 1 line
Jens Axboe
#6 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 15 lines · Bartlomiej Zolnierkiewicz
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Linux Kernel Mailing List

ChangeSet 1.1413, 2003/11/04 08:01:30-08:00,
[email protected]

	[PATCH] fix rq->flags use in ide-tape.c
Quoted 7 lines
Quoted 1 line

Noticed by [email protected]:

Guys, this is _way_ ugly. We definitely dont need more crap in ->flags for private driver use, stuff them somewhere else in the rq. rq->cmd[0] usage would be a whole lot better. This patch should never have been merged. If each and every driver needs 5 private bits in ->flags, well...

Quoted 3 lines

Yeah, it is ugly. Using rq->cmd is also ugly as it hides the problem in ide-tape.c, but if you prefer this way I can clean it up. I just wanted minimal changes to ide-tape.c to make it working.

Also putting these flags in rq->cmd[0] makes it hard to later convert ide-tape.c to use rq->cmd[] for storing packet commands.

--bartlomiej

author
#7 lore raw
Quoted 16 lines · Bartlomiej Zolnierkiewicz
Quoted 15 lines · Bartlomiej Zolnierkiewicz
Quoted 13 lines · Jens Axboe
Quoted 6 lines · Linux Kernel Mailing List

ChangeSet 1.1413, 2003/11/04 08:01:30-08:00,
[email protected]

	[PATCH] fix rq->flags use in ide-tape.c

	Noticed by [email protected]:

Guys, this is _way_ ugly. We definitely dont need more crap in ->flags for private driver use, stuff them somewhere else in the rq. rq->cmd[0] usage would be a whole lot better. This patch should never have been merged. If each and every driver needs 5 private bits in ->flags, well...

Quoted 6 lines
Quoted 3 lines

Yeah, it is ugly. Using rq->cmd is also ugly as it hides the problem in ide-tape.c, but if you prefer this way I can clean it up. I just wanted minimal changes to ide-tape.c to make it working.

Also putting these flags in rq->cmd[0] makes it hard to later convert ide-tape.c to use rq->cmd[] for storing packet commands.

What's wrong with just looking at the opcode instead of inventing magic flags. Seems like _just_ the right thing to do, convert to really using rq and killing the private command stuff as much as possible. The latter can wait though, the flag thing really has to go right now.

ide-*.c driver by Gadi are all completely over designed and attempts to basically implement everything themselves. Horrible.

Signature · 1 line
Jens Axboe
#8 lore raw
Quoted 21 lines · Jens Axboe
Quoted 20 lines · Bartlomiej Zolnierkiewicz
Quoted 18 lines · Bartlomiej Zolnierkiewicz
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Linux Kernel Mailing List

ChangeSet 1.1413, 2003/11/04 08:01:30-08:00,
[email protected]

	[PATCH] fix rq->flags use in ide-tape.c
Quoted 7 lines
Quoted 1 line

Noticed by [email protected]:

Guys, this is _way_ ugly. We definitely dont need more crap in ->flags for private driver use, stuff them somewhere else in the rq. rq->cmd[0] usage would be a whole lot better. This patch should never have been merged. If each and every driver needs 5 private bits in ->flags, well...

Yeah, it is ugly. Using rq->cmd is also ugly as it hides the problem in ide-tape.c, but if you prefer this way I can clean it up. I just wanted minimal changes to ide-tape.c to make it working.

Quoted 7 lines
Quoted 2 lines

Also putting these flags in rq->cmd[0] makes it hard to later convert ide-tape.c to use rq->cmd[] for storing packet commands.

What's wrong with just looking at the opcode instead of inventing magic flags. Seems like _just_ the right thing to do, convert to really using rq and killing the private command stuff as much as possible. The latter can wait though, the flag thing really has to go right now.

It is non-trivial cause it seems packet commands are prepared during processing request, not prior to queuing it. Also I still don't fully understand driver inner-workings with respect to DSC, "pipeline" and internal commands processing.

Quoted 2 lines

ide-*.c driver by Gadi are all completely over designed and attempts to basically implement everything themselves. Horrible.

Yep, but we should be careful in removing cruft. I've already had a hard time fixing it after (totally unnecessary and broken) buffer_head->bio conversion.

cheers,
--bartlomiej

author
#9 lore raw
Quoted 25 lines · Bartlomiej Zolnierkiewicz
Quoted 24 lines · Jens Axboe
Quoted 22 lines · Bartlomiej Zolnierkiewicz
Quoted 15 lines · Bartlomiej Zolnierkiewicz
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Linux Kernel Mailing List

ChangeSet 1.1413, 2003/11/04 08:01:30-08:00,
[email protected]

	[PATCH] fix rq->flags use in ide-tape.c
Quoted 7 lines
Quoted 1 line

Noticed by [email protected]:

Guys, this is _way_ ugly. We definitely dont need more crap in ->flags for private driver use, stuff them somewhere else in the rq. rq->cmd[0] usage would be a whole lot better. This patch should never have been merged. If each and every driver needs 5 private bits in ->flags, well...

Quoted 3 lines

Yeah, it is ugly. Using rq->cmd is also ugly as it hides the problem in ide-tape.c, but if you prefer this way I can clean it up. I just wanted minimal changes to ide-tape.c to make it working.

Also putting these flags in rq->cmd[0] makes it hard to later convert ide-tape.c to use rq->cmd[] for storing packet commands.

Quoted 7 lines
Quoted 4 lines

What's wrong with just looking at the opcode instead of inventing magic flags. Seems like _just_ the right thing to do, convert to really using rq and killing the private command stuff as much as possible. The latter can wait though, the flag thing really has to go right now.

It is non-trivial cause it seems packet commands are prepared during processing request, not prior to queuing it. Also I still don't fully

Definitely, it can be done at a later stage.

Quoted 2 lines

understand driver inner-workings with respect to DSC, "pipeline" and internal commands processing.

I don't blame you :)

Quoted 6 lines
Quoted 2 lines

ide-*.c driver by Gadi are all completely over designed and attempts to basically implement everything themselves. Horrible.

Yep, but we should be careful in removing cruft. I've already had a hard time fixing it after (totally unnecessary and broken) buffer_head->bio conversion.

Yup that wasn't a very good conversion... I think I even complained at the time to whomever did it. In my opinion, it's better to keep the driver broken than accept a bad conversion (someone doing it without really understanding the driver nor bio stuff) that makes it compile. The latter is what happened.

Signature · 1 line
Jens Axboe
author
#10 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 15 lines · Bartlomiej Zolnierkiewicz
Quoted 6 lines · Jens Axboe
Quoted 5 lines · Linux Kernel Mailing List

ChangeSet 1.1413, 2003/11/04 08:01:30-08:00,
[email protected]

	[PATCH] fix rq->flags use in ide-tape.c
Quoted 7 lines
Quoted 1 line

Noticed by [email protected]:

Guys, this is _way_ ugly. We definitely dont need more crap in ->flags for private driver use, stuff them somewhere else in the rq. rq->cmd[0] usage would be a whole lot better. This patch should never have been merged. If each and every driver needs 5 private bits in ->flags, well...

Quoted 3 lines

Yeah, it is ugly. Using rq->cmd is also ugly as it hides the problem in ide-tape.c, but if you prefer this way I can clean it up. I just wanted minimal changes to ide-tape.c to make it working.

Well using ->cmd is acceptable. Adding these 5 bits for ide-tape is, on the other hand, completely and utterly unacceptable. So I'd greatly prefer it that way :)

Quoted 3 lines
Quoted 1 line

Was this even posted on linux-kernel for review?

Yes.

Ok missed it then.

Signature · 1 line
Jens Axboe