sg: Clean up handling of big endian data fields
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Thu, 21 Feb 2019 04:11:01 +0000 (13:11 +0900)
committerJens Axboe <axboe@kernel.dk>
Sun, 24 Feb 2019 04:19:01 +0000 (21:19 -0700)
commita824149a09e541c08e2236d8c6b828437e7781a7
treef83667b511da24b95d02a032d9d1838857e8cf93
parent02ae7bd8339435c982f134ca63ee9062c1d92b8e
sg: Clean up handling of big endian data fields

Getting and setting values in SCSI commands and descriptors,
which are big endian, in SG driver can use a bit of cleanup.
This patch simplifies SG driver code by introducing a set of
accessor functions for reading raw big endian values from SCSI
buffers and another set for properly storing the local values
as big endian byte sequences.

The patch also adds some missing endianness conversion macros
in os.h.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/sg.c
os/os.h