Re: [PATCH V2 3/5] ublk_drv: add SET_PARAM/GET_PARAM control command

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

 



Hi Christoph,

On Wed, Jul 27, 2022 at 06:22:34PM +0200, Christoph Hellwig wrote:
> As stated in the previous discussion I think this is a very bad idea
> that leads to a lot of boiler plate code.  If you don't want to rely

But you never point out where the boiler plate code is, care to share
what/where it is?

If you don't like xarray, we can replace it with one plain array
from the beginning, this change is just in implementation level.

Given it is ABI interface, I'd suggest to consolidate it from the
beginning.

> on zeroed fields we can add a mask of valid fields, similar to how
> e.g. the statx API works.

With one mask for marking valid fields, we still need to group
fields, and one bit in mask has to represent one single group, and
it can't represent each single field.

Also one length field has to be added in the header for keeping
compatibility with old app.

With the above two change, it becomes very similar with the approach
in this patch.

IMO there are more advantages in grouping parameter explicitly:

1) avoid big chunk of memory for storing lots of unnecessary parameter
if the big params data structure is extended, and we just store whatever
the userspace cares.

2) easy to add new type by just implementing two callbacks(both optionally),
and code is actually well organized, and each callback just focuses on the
interested parameter type 

3) parameter is easier to verify, since we know each parameter's length and type.
With mask, we can only know if one parameter type exists in the big
parameters data structure or not.


Thanks,
Ming




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux