lkml.org 
[lkml]   [2013]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/13] sg_io: reorganize list of allowed commands
On Thu, Jan 24, 2013 at 02:42:03PM -0800, Tejun Heo wrote:
> One other thing is I would much prefer if the table was made static
> const first. As we only allow compile-time defined tables, there's no
> point in dynamically initializing these and the above can be static
> initializers.

On the similar line of thoughts, wouldn't it be better to have the
table organized by the device type first? It would be much easier to
comprehend which commands are allowed for each device type that way
and FWIW it would be more cacheline friendly. e.g. something like,

#define M(opcode) (1 << opcode)

#define COMMON \
M(READ_6) | M(WRITE_6) | ....

static const whatever_type blk_cmd_filter_disk = {
COMMON |
M(CMD_SPECIFIC_TO_THIS_TYPE0) |
M(CMD_SPECIFIC_TO_THIS_TYPE2) |
...
};

Thanks.

--
tejun


\
 
 \ /
  Last update: 2013-01-25 00:24    [W:0.055 / U:1.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site