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.
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to