diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-06-05 14:39:01 +0200 |
---|---|---|
committer | Fam Zheng <famz@redhat.com> | 2017-06-16 07:55:00 +0800 |
commit | 47fec59941a7182380bc8dde3faf17cfb05b770f (patch) | |
tree | 0e5ca648e4f3f28680f6b2497f1845a8b678c4d3 /block.c | |
parent | f7946da274cf451d66e5207f21286fea14c4795d (diff) | |
download | qemu-47fec59941a7182380bc8dde3faf17cfb05b770f.zip |
block: access write_gen with atomics
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20170605123908.18777-13-pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3424,7 +3424,7 @@ int bdrv_truncate(BdrvChild *child, int64_t offset, Error **errp) ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS); bdrv_dirty_bitmap_truncate(bs); bdrv_parent_cb_resize(bs); - ++bs->write_gen; + atomic_inc(&bs->write_gen); } return ret; } |