On 9/16/19 7:57 AM, Jinpu Wang wrote:
+#define _IBNBD_FILEIO 0 +#define _IBNBD_BLOCKIO 1 +#define _IBNBD_AUTOIO 2+enum ibnbd_io_mode { + IBNBD_FILEIO = _IBNBD_FILEIO, + IBNBD_BLOCKIO = _IBNBD_BLOCKIO, + IBNBD_AUTOIO = _IBNBD_AUTOIO, +};Since the IBNBD_* and _IBNBD_* constants have the same numerical value, are the former constants really necessary?
>>
Seems we can remove _IBNBD_*.
>
Sorry, checked again, we defined _IBNBD_* constants to show the right value for def_io_mode description. If we remove the _IBNBD_*, then the modinfo shows: def_io_mode:By default, export devices in blockio(IBNBD_BLOCKIO) or fileio(IBNBD_FILEIO) mode. (default: IBNBD_BLOCKIO (blockio)) instead of: parm: def_io_mode:By default, export devices in blockio(1) or fileio(0) mode. (default: 1 (blockio))
So the user is required to enter def_io_mode as a number? Wouldn't it be more friendly towards users to change that parameter from a number into a string?
Thanks, Bart.
