[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 36/50] block/copy-before-write.h: global state API + assertions
From: |
Kevin Wolf |
Subject: |
[PULL 36/50] block/copy-before-write.h: global state API + assertions |
Date: |
Fri, 4 Mar 2022 17:46:57 +0100 |
From: Emanuele Giuseppe Esposito <eesposit@redhat.com>
copy-before-write functions always run under BQL.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220303151616.325444-24-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/copy-before-write.h | 7 +++++++
block/copy-before-write.c | 2 ++
2 files changed, 9 insertions(+)
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,
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);
}
--
2.35.1
- Re: [PULL 21/50] block/block-backend.c: assertions for block-backend, (continued)
- [PULL 23/50] block.c: assertions to the block layer permissions API, Kevin Wolf, 2022/03/04
- [PULL 22/50] IO_CODE and IO_OR_GS_CODE for block-backend I/O API, Kevin Wolf, 2022/03/04
- [PULL 25/50] assertions for block_int global state API, Kevin Wolf, 2022/03/04
- [PULL 24/50] include/block/block_int: split header into I/O and global state API, Kevin Wolf, 2022/03/04
- [PULL 26/50] IO_CODE and IO_OR_GS_CODE for block_int I/O API, Kevin Wolf, 2022/03/04
- [PULL 28/50] include/block/blockjob_int.h: split header into I/O and GS API, Kevin Wolf, 2022/03/04
- [PULL 29/50] GS and IO CODE macros for blockjob_int.h, Kevin Wolf, 2022/03/04
- [PULL 31/50] include/block/blockjob.h: global state API, Kevin Wolf, 2022/03/04
- [PULL 30/50] block.c: add assertions to static functions, Kevin Wolf, 2022/03/04
- [PULL 36/50] block/copy-before-write.h: global state API + assertions,
Kevin Wolf <=
- [PULL 37/50] block/coroutines: I/O and "I/O or GS" API, Kevin Wolf, 2022/03/04
- [PULL 38/50] block_int-common.h: split function pointers in BlockDriver, Kevin Wolf, 2022/03/04
- [PULL 39/50] block_int-common.h: assertions in the callers of BlockDriver function pointers, Kevin Wolf, 2022/03/04
- [PULL 41/50] block_int-common.h: assertions in the callers of BdrvChildClass function pointers, Kevin Wolf, 2022/03/04
- [PULL 42/50] block-backend-common.h: split function pointers in BlockDevOps, Kevin Wolf, 2022/03/04
- [PULL 44/50] job.h: assertions in the callers of JobDriver function pointers, Kevin Wolf, 2022/03/04
- [PULL 40/50] block_int-common.h: split function pointers in BdrvChildClass, Kevin Wolf, 2022/03/04
- [PULL 43/50] job.h: split function pointers in JobDriver, Kevin Wolf, 2022/03/04
- [PULL 45/50] block: Make bdrv_refresh_limits() non-recursive, Kevin Wolf, 2022/03/04
- [PULL 47/50] iotests/graph-changes-while-io: New test, Kevin Wolf, 2022/03/04