Re: [PATCH 27/32] scsi_data_buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 18 Oct 2007, Matthew Wilcox wrote:

> > I will grab your tool and play with it. The sglist pointer shuffle
> > is good, and also I know that if you put the scsi_data_buffer
> > at the beginning of scsi_cmnd, than you can fill the holes with small types
> > following the sub-structure. I'll give it a try.
> 
> No, that doesn't work ;-(
> 
> I think a macro to hide the ugliness of my earlier suggestion might fly.
> Something like ...
> 
> #define STRUCT_PACK(a, b, c, d) \
> 	union { a; struct { \
> 		char _packed_ ## __stringify(a) [sizeof(a) - sizeof(c) + sizeof(d)]; \
> 		b; \
> 	}; }
> 
> then we use it like:
> 
> struct scsi_cmnd {
> 	...
> 	STRUCT_PACK(struct scsi_data_buffer sdb, int result,
> 						sizeof(long), sizeof(int));
> }
> 
> Even that's still pretty foul (and i have my grave doubts about using
> stringify in that manner).  It's definitely past my bedtime now ... but
> a hack like that could save us another 8 bytes on x86-64.

This may seem heretical, but I doubt there's much point to saving a few 
bytes if it's going to incur this much work and confusion.  Rearranging 
the order of structure members is fine, it's easy, it won't bother 
anybody.  But this sort of thing is just beyond the bounds of reason.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux