Skip to contentSkip to conversation

The future of host_scribble

DISCUSSION Matthew Wilcox 2 participants 2 messages Apr 21, 2005 SCSI

lore
Share & tools
lore
#0 lore raw

In scsi_cmnd there's an element called host_scribble. The name and the comment by it were sufficiently confusing that I didn't realise that this field is basically for the host's private data. Any objections to something like this, assuming I also submit a patch that converts all the drivers?

+++ include/scsi/scsi_cmnd.h 2005-04-20 20:16:41.562034944 -0400
@@ -129,13 +129,8 @@
*/
struct scsi_pointer SCp; /* Scratchpad used by some host adapters */

- unsigned char *host_scribble; /* The host adapter is allowed to

-                                          * call scsi_malloc and get some memory
-                                          * and hang it here.     The host adapter
-                                          * is also expected to call scsi_free
-                                          * to release this memory.  (The memory
-                                          * obtained by scsi_malloc is guaranteed
-                                          * to be at an address < 16Mb). */

+ void *host_data; /* Pointer to the host's data structure
+ * associated with this command. */

int result; /* Status code from lower level driver */

(the only remaining references to scsi_malloc are in comments ... I'll submit a different patch to remove those too)

Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
#1 lore raw
Quoted 5 lines · Matthew Wilcox

In scsi_cmnd there's an element called host_scribble. The name and the comment by it were sufficiently confusing that I didn't realise that this field is basically for the host's private data. Any objections to something like this, assuming I also submit a patch that converts all the drivers?

Actually the situation about private data in scsi_cmnd is worse, there's another private data, that's the scsi_pointer structure embedded as SCp member. If we're going to fix up naming we should find a way to fixup both an have a sensible name for both embedded and out of struct private data. I somehow doubt it's going to happen before we drop support for gcc 2.95 and thus can use anonymous unions :)