[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 23/31] block/copy-before-write.h: global state API + assertion
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v7 23/31] block/copy-before-write.h: global state API + assertions |
Date: |
Fri, 11 Feb 2022 09:51:45 -0500 |
copy-before-write functions always run under BQL.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
block/copy-before-write.c | 2 ++
block/copy-before-write.h | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/block/copy-before-write.c b/block/copy-before-write.c
index c30a5ff8de..80b7684dba 100644
--- a/block/copy-before-write.c
+++ b/block/copy-before-write.c
@@ -223,6 +223,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
QDict *opts;
assert(source->total_sectors == target->total_sectors);
+ GLOBAL_STATE_CODE();
opts = qdict_new();
qdict_put_str(opts, "driver", "copy-before-write");
@@ -245,6 +246,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
void bdrv_cbw_drop(BlockDriverState *bs)
{
+ GLOBAL_STATE_CODE();
bdrv_drop_filter(bs, &error_abort);
bdrv_unref(bs);
}
diff --git a/block/copy-before-write.h b/block/copy-before-write.h
index 51847e711a..6e72bb25e9 100644
--- a/block/copy-before-write.h
+++ b/block/copy-before-write.h
@@ -29,6 +29,13 @@
#include "block/block_int.h"
#include "block/block-copy.h"
+/*
+ * Global state (GS) API. These functions run under the BQL.
+ *
+ * See include/block/block-global-state.h for more information about
+ * the GS API.
+ */
+
BlockDriverState *bdrv_cbw_append(BlockDriverState *source,
BlockDriverState *target,
const char *filter_node_name,
--
2.31.1
- [PATCH v7 21/31] assertions for blockdev.h global state API, (continued)
- [PATCH v7 21/31] assertions for blockdev.h global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 26/31] block_int-common.h: assertions in the callers of BlockDriver function pointers, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 09/31] IO_CODE and IO_OR_GS_CODE for block-backend I/O API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 18/31] include/block/blockjob.h: global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 11/31] include/block/block_int: split header into I/O and global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 03/31] include/block/block: split header into I/O and global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 17/31] block.c: add assertions to static functions, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 14/31] block: introduce assert_bdrv_graph_writable, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 19/31] assertions for blockjob.h global state API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 22/31] include/block/snapshot: global state API + assertions, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 23/31] block/copy-before-write.h: global state API + assertions,
Emanuele Giuseppe Esposito <=
- [PATCH v7 24/31] block/coroutines: I/O and "I/O or GS" API, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 25/31] block_int-common.h: split function pointers in BlockDriver, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 27/31] block_int-common.h: split function pointers in BdrvChildClass, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 28/31] block_int-common.h: assertions in the callers of BdrvChildClass function pointers, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 29/31] block-backend-common.h: split function pointers in BlockDevOps, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 30/31] job.h: split function pointers in JobDriver, Emanuele Giuseppe Esposito, 2022/02/11
- [PATCH v7 31/31] job.h: assertions in the callers of JobDriver function pointers, Emanuele Giuseppe Esposito, 2022/02/11