MINOR: shctx: Add new reserve_finish callback call to shctx_row_reserve_hot

This patch adds a reserve_finish callback that can be defined by the
subsystems that require a shared_context. It is called at the end of
shctx_row_reserve_hot after the shared_context lock is released.
This commit is contained in:
Remi Tricot-Le Breton 2023-11-16 17:38:24 +01:00 committed by William Lallemand
parent 11df806c88
commit 1cd91b4f2a
2 changed files with 4 additions and 0 deletions

View File

@ -51,6 +51,7 @@ struct shared_context {
unsigned int nbav; /* number of available blocks */
unsigned int max_obj_size; /* maximum object size (in bytes). */
void (*free_block)(struct shared_block *first, struct shared_block *block, void *data);
void (*reserve_finish)(struct shared_context *shctx);
void *cb_data;
short int block_size;
unsigned char data[VAR_ARRAY];

View File

@ -110,6 +110,9 @@ struct shared_block *shctx_row_reserve_hot(struct shared_context *shctx,
shctx_wrunlock(shctx);
if (shctx->reserve_finish)
shctx->reserve_finish(shctx);
out:
return ret;
}