[Devel] [PATCH RH9 v4 01/10] drivers/vhost: vhost-blk accelerator for virtio-blk guests
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Fri Nov 4 14:31:27 MSK 2022
On 01.11.2022 10:25, Andrey Zhadchenko wrote:
> +/* It is forbidden to call more than one vhost_blk_flush() simultaneously */
> +static void vhost_blk_flush(struct vhost_blk *blk)
> +{
> + int flush_bin;
> +
> + spin_lock(&blk->flush_lock);
> + blk->during_flush = 1;
> + flush_bin = blk->new_req_bin;
> + blk->new_req_bin = (blk->new_req_bin) ? 0 : 1;
We can use shorter and simpler expression for this:
blk->new_req_bin = !blk->new_req_bin;
> + spin_unlock(&blk->flush_lock);
--
Best regards, Tikhomirov Pavel
Software Developer, Virtuozzo.
More information about the Devel
mailing list