Re: [PATCH v4 15/25] ibnbd: private headers with IBNBD protocol structs and helpers

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

 



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.




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux