zbd: Avoid duplicating the code for calculating the number of sectors with data
authorBart Van Assche <bvanassche@acm.org>
Fri, 28 Sep 2018 21:51:33 +0000 (14:51 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 29 Sep 2018 21:16:26 +0000 (15:16 -0600)
commit91d2513127442c4946dc99978870c4dc4f58427d
tree3c0487d6122d40c2133f2695451f565a613bc8da
parent615555bbac860c9af51a6774d70a59312db93e2b
zbd: Avoid duplicating the code for calculating the number of sectors with data

Introduce a new function process_swd() to avoid that almost identical code
occurs in check_swd() and zbd_file_reset(). Change the #if 0 / #endif pair
in check_swd() into if (false) to make sure that the compiler verifies the
syntactical correctness of that code.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c