GS and IO CODE macros for blockjob_int.h

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220303151616.325444-17-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Emanuele Giuseppe Esposito 2022-03-03 10:16:01 -05:00 committed by Kevin Wolf
parent 2015c4c28d
commit e2d9faf534

View File

@ -84,6 +84,7 @@ BlockJob *block_job_get(const char *id)
void block_job_free(Job *job) void block_job_free(Job *job)
{ {
BlockJob *bjob = container_of(job, BlockJob, job); BlockJob *bjob = container_of(job, BlockJob, job);
GLOBAL_STATE_CODE();
block_job_remove_all_bdrv(bjob); block_job_remove_all_bdrv(bjob);
ratelimit_destroy(&bjob->limit); ratelimit_destroy(&bjob->limit);
@ -299,6 +300,7 @@ bool block_job_set_speed(BlockJob *job, int64_t speed, Error **errp)
int64_t block_job_ratelimit_get_delay(BlockJob *job, uint64_t n) int64_t block_job_ratelimit_get_delay(BlockJob *job, uint64_t n)
{ {
IO_CODE();
return ratelimit_calculate_delay(&job->limit, n); return ratelimit_calculate_delay(&job->limit, n);
} }
@ -434,6 +436,7 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
{ {
BlockJob *job; BlockJob *job;
int ret; int ret;
GLOBAL_STATE_CODE();
if (job_id == NULL && !(flags & JOB_INTERNAL)) { if (job_id == NULL && !(flags & JOB_INTERNAL)) {
job_id = bdrv_get_device_name(bs); job_id = bdrv_get_device_name(bs);
@ -498,6 +501,7 @@ void block_job_iostatus_reset(BlockJob *job)
void block_job_user_resume(Job *job) void block_job_user_resume(Job *job)
{ {
BlockJob *bjob = container_of(job, BlockJob, job); BlockJob *bjob = container_of(job, BlockJob, job);
GLOBAL_STATE_CODE();
block_job_iostatus_reset(bjob); block_job_iostatus_reset(bjob);
} }
@ -505,6 +509,7 @@ BlockErrorAction block_job_error_action(BlockJob *job, BlockdevOnError on_err,
int is_read, int error) int is_read, int error)
{ {
BlockErrorAction action; BlockErrorAction action;
IO_CODE();
switch (on_err) { switch (on_err) {
case BLOCKDEV_ON_ERROR_ENOSPC: case BLOCKDEV_ON_ERROR_ENOSPC: