]> git.baikalelectronics.ru Git - kernel.git/commit
null-blk: save memory footprint for struct nullb_cmd
authorYu Kuai <yukuai3@huawei.com>
Tue, 26 Apr 2022 02:21:33 +0000 (10:21 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Apr 2022 02:31:20 +0000 (20:31 -0600)
commitdd65a191c0472ad7a035afeca7f199f018789b68
treec98b1136d919cf557596022061c32920b39371cf
parent12f245423e3bd93eb0f928195a02981564033a06
null-blk: save memory footprint for struct nullb_cmd

Total 16 bytes can be saved in two ways:

1) The field 'bio' will only be used in bio based mode, and the field
   'rq' will only be used in mq mode. Since they won't be used in the
   same time, declare a union for them.
2) The field 'bool fake_timeout' can be placed in the hole after the
   field 'error'.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20220426022133.3999006-1-yukuai3@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk/null_blk.h