[stgt] [PATCH] Add an array that describes which opcodes are supported by the RDWR and SHEEPDOG backends.

Dan Mick dan.mick at inktank.com
Thu Nov 7 22:46:36 CET 2013


>>> I see, thanks. Using the bitmaps is simpler than the array of char if
>>> you calculate delta and such?
>>
>> I think using the array with opcode names is simpler for a human to
>> comparing when reading the sourcecode.
>>
>>
>> I had a bitmap of 32 bytes, one bit for each opcode,   and I also
>> tried using an array of 256 bytes, one byte 0/1 for each opcode
>> but it was horrible to read from a human standpoint.
>>
>> When reading the code and the bitmap/array it was very difficult to
>> see which opcodes were supported and which were not
>> by just looking at the bits.
>> It was also errorprone and I did several mistakes when building the
>> bitmap manually.
>
> Why you built it manually? You can do something like
>
> set_bit(WRITE_6, bitmap_addr);
>
> ?
>
> As usual, you can steal bitmap functions from Linux kernel.

Is it worth it to mess around with bits when chars are easily
manipulated?  Sure, it's 8x the data, but it's much easier to dump,
examine in debuggers, etc., and it's 256 bytes; hardly worthy of notice.
Bitmaps are a pain in general.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list