Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-25 Thread Paolo Bonzini
Il 25/01/2013 18:13, Tejun Heo ha scritto: > Hello, Paolo. > > On Fri, Jan 25, 2013 at 11:01:38AM +0100, Paolo Bonzini wrote: >> First, because the table is based on >> http://www.t10.org/lists/op-num.txt. Entries in that file look like this: >> >> OP DTLPWROMAEBKVF Description >> --

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-25 Thread Tejun Heo
Hello, Paolo. On Fri, Jan 25, 2013 at 11:01:38AM +0100, Paolo Bonzini wrote: > First, because the table is based on > http://www.t10.org/lists/op-num.txt. Entries in that file look like this: > > OP DTLPWROMAEBKVF Description > -- --

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-25 Thread Paolo Bonzini
Il 24/01/2013 23:58, Tejun Heo ha scritto: > >> +#define sgio_bitmap_set(cmd, mask, rw) \ >> +if ((mask) != 0) __set_bit((cmd), filter->rw##_ok) >> + >> +#define D (1u << TYPE_DISK) /* Direct Access Block Device (SBC-3) >> */ >> +#define T (1u << TYPE_TAPE) /* Sequential

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-25 Thread Paolo Bonzini
Il 24/01/2013 23:58, Tejun Heo ha scritto: +#define sgio_bitmap_set(cmd, mask, rw) \ +if ((mask) != 0) __set_bit((cmd), filter-rw##_ok) + +#define D (1u TYPE_DISK) /* Direct Access Block Device (SBC-3) */ +#define T (1u TYPE_TAPE) /* Sequential Access Device

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-25 Thread Tejun Heo
Hello, Paolo. On Fri, Jan 25, 2013 at 11:01:38AM +0100, Paolo Bonzini wrote: First, because the table is based on http://www.t10.org/lists/op-num.txt. Entries in that file look like this: OP DTLPWROMAEBKVF Description -- --

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-25 Thread Paolo Bonzini
Il 25/01/2013 18:13, Tejun Heo ha scritto: Hello, Paolo. On Fri, Jan 25, 2013 at 11:01:38AM +0100, Paolo Bonzini wrote: First, because the table is based on http://www.t10.org/lists/op-num.txt. Entries in that file look like this: OP DTLPWROMAEBKVF Description -- --

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-24 Thread Tejun Heo
On Thu, Jan 24, 2013 at 02:49:21PM -0800, Tejun Heo wrote: > 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

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-24 Thread Tejun Heo
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

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-24 Thread Tejun Heo
On Thu, Jan 24, 2013 at 04:00:38PM +0100, Paolo Bonzini wrote: > +#define sgio_bitmap_set(cmd, mask, rw) \ > + if ((mask) != 0) __set_bit((cmd), filter->rw##_ok) > + > +#define D (1u << TYPE_DISK) /* Direct Access Block Device (SBC-3) > */ > +#define T (1u << TYPE_TAPE) /*

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-24 Thread Tejun Heo
On Thu, Jan 24, 2013 at 04:00:38PM +0100, Paolo Bonzini wrote: +#define sgio_bitmap_set(cmd, mask, rw) \ + if ((mask) != 0) __set_bit((cmd), filter-rw##_ok) + +#define D (1u TYPE_DISK) /* Direct Access Block Device (SBC-3) */ +#define T (1u TYPE_TAPE) /* Sequential

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-24 Thread Tejun Heo
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

Re: [PATCH 02/13] sg_io: reorganize list of allowed commands

2013-01-24 Thread Tejun Heo
On Thu, Jan 24, 2013 at 02:49:21PM -0800, Tejun Heo wrote: 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