]> git.ipfire.org Git - people/ms/linux.git/commit
ublk: simplify ublk_ch_open and ublk_ch_release
authorChristoph Hellwig <hch@lst.de>
Thu, 21 Jul 2022 13:09:12 +0000 (15:09 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Jul 2022 16:52:12 +0000 (10:52 -0600)
commitfa362045564ea7641e7d48295b54f4eb4df689ea
tree02bf9349465e65b2a0d3820770782957155173b6
parent49d686cceed2e3148ba2bd2dec7e09b86eba0337
ublk: simplify ublk_ch_open and ublk_ch_release

fops->open and fops->release are always paired.  Use simple atomic bit
ops ot indicate if the device is opened instead of a count that can
only be 0 and 1 and a useless cmpxchg loop in ublk_ch_release.

Also don't bother clearing file->private_data is the file is about to
be freed anyway.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220721130916.1869719-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c