os-linux: Cleanup IO priority class and value macros
authorDamien Le Moal <dlemoal@kernel.org>
Fri, 21 Jul 2023 11:05:05 +0000 (20:05 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 21 Jul 2023 20:07:28 +0000 (14:07 -0600)
commitd4d503a557d4a664ff3fd7a811966df038d06634
treef79f0aba8836b600fdcebe46d122e938925c0b45
parentfc37e3dedee9026a4e745c7ab03ed293cb04eb60
os-linux: Cleanup IO priority class and value macros

In os/os-linux.h, define the ioprio() macro using the already defined
IOPRIO_MAX_PRIO macro instead of hard coding the maximum priority value
again. Also move the definitions of the ioprio_class() and ioprio()
macros before the ioprio_value() function and use ioprio_class() inside
ioprio_value_is_class_rt() instead of re-coding the iopriority class
extraction again in that function.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Link: https://lore.kernel.org/r/20230721110510.44772-2-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
os/os-linux.h