Skip to content

Commit

Permalink
block: Rename BlockDriverCompletionFunc to BlockCompletionFunc
Browse files Browse the repository at this point in the history
I'll use it with block backends shortly, and the name is going to fit
badly there.  It's a block layer thing anyway, not just a block driver
thing.

Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
Markus Armbruster authored and kevmw committed Oct 20, 2014
1 parent 7c84b1b commit 097310b
Show file tree
Hide file tree
Showing 42 changed files with 132 additions and 132 deletions.
30 changes: 15 additions & 15 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ struct BdrvDirtyBitmap {
static void bdrv_dev_change_media_cb(BlockDriverState *bs, bool load);
static BlockAIOCB *bdrv_aio_readv_em(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
BlockCompletionFunc *cb, void *opaque);
static BlockAIOCB *bdrv_aio_writev_em(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
BlockCompletionFunc *cb, void *opaque);
static int coroutine_fn bdrv_co_readv_em(BlockDriverState *bs,
int64_t sector_num, int nb_sectors,
QEMUIOVector *iov);
Expand All @@ -84,7 +84,7 @@ static BlockAIOCB *bdrv_co_aio_rw_vector(BlockDriverState *bs,
QEMUIOVector *qiov,
int nb_sectors,
BdrvRequestFlags flags,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque,
bool is_write);
static void coroutine_fn bdrv_co_do_rw(void *opaque);
Expand Down Expand Up @@ -4415,7 +4415,7 @@ int bdrv_get_backing_file_depth(BlockDriverState *bs)

BlockAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num,
QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
trace_bdrv_aio_readv(bs, sector_num, nb_sectors, opaque);

Expand All @@ -4425,7 +4425,7 @@ BlockAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num,

BlockAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num,
QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
trace_bdrv_aio_writev(bs, sector_num, nb_sectors, opaque);

Expand All @@ -4435,7 +4435,7 @@ BlockAIOCB *bdrv_aio_writev(BlockDriverState *bs, int64_t sector_num,

BlockAIOCB *bdrv_aio_write_zeroes(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, BdrvRequestFlags flags,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
trace_bdrv_aio_write_zeroes(bs, sector_num, nb_sectors, flags, opaque);

Expand All @@ -4450,7 +4450,7 @@ typedef struct MultiwriteCB {
int num_requests;
int num_callbacks;
struct {
BlockDriverCompletionFunc *cb;
BlockCompletionFunc *cb;
void *opaque;
QEMUIOVector *free_qiov;
} callbacks[];
Expand Down Expand Up @@ -4688,7 +4688,7 @@ static BlockAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,
int64_t sector_num,
QEMUIOVector *qiov,
int nb_sectors,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque,
int is_write)

Expand Down Expand Up @@ -4717,14 +4717,14 @@ static BlockAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,

static BlockAIOCB *bdrv_aio_readv_em(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
return bdrv_aio_rw_vector(bs, sector_num, qiov, nb_sectors, cb, opaque, 0);
}

static BlockAIOCB *bdrv_aio_writev_em(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
return bdrv_aio_rw_vector(bs, sector_num, qiov, nb_sectors, cb, opaque, 1);
}
Expand Down Expand Up @@ -4775,7 +4775,7 @@ static BlockAIOCB *bdrv_co_aio_rw_vector(BlockDriverState *bs,
QEMUIOVector *qiov,
int nb_sectors,
BdrvRequestFlags flags,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque,
bool is_write)
{
Expand Down Expand Up @@ -4806,7 +4806,7 @@ static void coroutine_fn bdrv_aio_flush_co_entry(void *opaque)
}

BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
trace_bdrv_aio_flush(bs, opaque);

Expand All @@ -4833,7 +4833,7 @@ static void coroutine_fn bdrv_aio_discard_co_entry(void *opaque)

BlockAIOCB *bdrv_aio_discard(BlockDriverState *bs,
int64_t sector_num, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
Coroutine *co;
BlockAIOCBCoroutine *acb;
Expand Down Expand Up @@ -4861,7 +4861,7 @@ void bdrv_init_with_whitelist(void)
}

void *qemu_aio_get(const AIOCBInfo *aiocb_info, BlockDriverState *bs,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
BlockAIOCB *acb;

Expand Down Expand Up @@ -5281,7 +5281,7 @@ int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)

BlockAIOCB *bdrv_aio_ioctl(BlockDriverState *bs,
unsigned long int req, void *buf,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
BlockDriver *drv = bs->drv;

Expand Down
8 changes: 4 additions & 4 deletions block/archipelago.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ static BlockAIOCB *qemu_archipelago_aio_rw(BlockDriverState *bs,
int64_t sector_num,
QEMUIOVector *qiov,
int nb_sectors,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque,
int op)
{
Expand Down Expand Up @@ -896,15 +896,15 @@ static BlockAIOCB *qemu_archipelago_aio_rw(BlockDriverState *bs,

static BlockAIOCB *qemu_archipelago_aio_readv(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
return qemu_archipelago_aio_rw(bs, sector_num, qiov, nb_sectors, cb,
opaque, ARCHIP_OP_READ);
}

static BlockAIOCB *qemu_archipelago_aio_writev(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
return qemu_archipelago_aio_rw(bs, sector_num, qiov, nb_sectors, cb,
opaque, ARCHIP_OP_WRITE);
Expand Down Expand Up @@ -1053,7 +1053,7 @@ static QemuOptsList qemu_archipelago_create_opts = {
};

static BlockAIOCB *qemu_archipelago_aio_flush(BlockDriverState *bs,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
return qemu_archipelago_aio_rw(bs, 0, NULL, 0, cb, opaque,
ARCHIP_OP_FLUSH);
Expand Down
2 changes: 1 addition & 1 deletion block/backup.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
int64_t speed, MirrorSyncMode sync_mode,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
BlockDriverCompletionFunc *cb, void *opaque,
BlockCompletionFunc *cb, void *opaque,
Error **errp)
{
int64_t len;
Expand Down
8 changes: 4 additions & 4 deletions block/blkdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static void error_callback_bh(void *opaque)
}

static BlockAIOCB *inject_error(BlockDriverState *bs,
BlockDriverCompletionFunc *cb, void *opaque, BlkdebugRule *rule)
BlockCompletionFunc *cb, void *opaque, BlkdebugRule *rule)
{
BDRVBlkdebugState *s = bs->opaque;
int error = rule->options.inject.error;
Expand All @@ -491,7 +491,7 @@ static BlockAIOCB *inject_error(BlockDriverState *bs,

static BlockAIOCB *blkdebug_aio_readv(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
BDRVBlkdebugState *s = bs->opaque;
BlkdebugRule *rule = NULL;
Expand All @@ -513,7 +513,7 @@ static BlockAIOCB *blkdebug_aio_readv(BlockDriverState *bs,

static BlockAIOCB *blkdebug_aio_writev(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
BDRVBlkdebugState *s = bs->opaque;
BlkdebugRule *rule = NULL;
Expand All @@ -534,7 +534,7 @@ static BlockAIOCB *blkdebug_aio_writev(BlockDriverState *bs,
}

static BlockAIOCB *blkdebug_aio_flush(BlockDriverState *bs,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
BDRVBlkdebugState *s = bs->opaque;
BlkdebugRule *rule = NULL;
Expand Down
8 changes: 4 additions & 4 deletions block/blkverify.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static int64_t blkverify_getlength(BlockDriverState *bs)
static BlkverifyAIOCB *blkverify_aio_get(BlockDriverState *bs, bool is_write,
int64_t sector_num, QEMUIOVector *qiov,
int nb_sectors,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque)
{
BlkverifyAIOCB *acb = qemu_aio_get(&blkverify_aiocb_info, bs, cb, opaque);
Expand Down Expand Up @@ -231,7 +231,7 @@ static void blkverify_verify_readv(BlkverifyAIOCB *acb)

static BlockAIOCB *blkverify_aio_readv(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
BDRVBlkverifyState *s = bs->opaque;
BlkverifyAIOCB *acb = blkverify_aio_get(bs, false, sector_num, qiov,
Expand All @@ -251,7 +251,7 @@ static BlockAIOCB *blkverify_aio_readv(BlockDriverState *bs,

static BlockAIOCB *blkverify_aio_writev(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
BDRVBlkverifyState *s = bs->opaque;
BlkverifyAIOCB *acb = blkverify_aio_get(bs, true, sector_num, qiov,
Expand All @@ -265,7 +265,7 @@ static BlockAIOCB *blkverify_aio_writev(BlockDriverState *bs,
}

static BlockAIOCB *blkverify_aio_flush(BlockDriverState *bs,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque)
{
BDRVBlkverifyState *s = bs->opaque;
Expand Down
2 changes: 1 addition & 1 deletion block/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static const BlockJobDriver commit_job_driver = {

void commit_start(BlockDriverState *bs, BlockDriverState *base,
BlockDriverState *top, int64_t speed,
BlockdevOnError on_error, BlockDriverCompletionFunc *cb,
BlockdevOnError on_error, BlockCompletionFunc *cb,
void *opaque, const char *backing_file_str, Error **errp)
{
CommitBlockJob *s;
Expand Down
2 changes: 1 addition & 1 deletion block/curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ static void curl_readv_bh_cb(void *p)

static BlockAIOCB *curl_aio_readv(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
CURLAIOCB *acb;

Expand Down
2 changes: 1 addition & 1 deletion block/iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status,

static BlockAIOCB *iscsi_aio_ioctl(BlockDriverState *bs,
unsigned long int req, void *buf,
BlockDriverCompletionFunc *cb, void *opaque)
BlockCompletionFunc *cb, void *opaque)
{
IscsiLun *iscsilun = bs->opaque;
struct iscsi_context *iscsi = iscsilun->iscsi;
Expand Down
2 changes: 1 addition & 1 deletion block/linux-aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ int laio_io_unplug(BlockDriverState *bs, void *aio_ctx, bool unplug)

BlockAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque, int type)
BlockCompletionFunc *cb, void *opaque, int type)
{
struct qemu_laio_state *s = aio_ctx;
struct qemu_laiocb *laiocb;
Expand Down
6 changes: 3 additions & 3 deletions block/mirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,
int64_t buf_size,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque, Error **errp,
const BlockJobDriver *driver,
bool is_none_mode, BlockDriverState *base)
Expand Down Expand Up @@ -673,7 +673,7 @@ void mirror_start(BlockDriverState *bs, BlockDriverState *target,
int64_t speed, int64_t granularity, int64_t buf_size,
MirrorSyncMode mode, BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque, Error **errp)
{
bool is_none_mode;
Expand All @@ -690,7 +690,7 @@ void mirror_start(BlockDriverState *bs, BlockDriverState *target,
void commit_active_start(BlockDriverState *bs, BlockDriverState *base,
int64_t speed,
BlockdevOnError on_error,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque, Error **errp)
{
int64_t length, base_length;
Expand Down
8 changes: 4 additions & 4 deletions block/null.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void null_bh_cb(void *opaque)
}

static inline BlockAIOCB *null_aio_common(BlockDriverState *bs,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque)
{
NullAIOCB *acb;
Expand All @@ -109,7 +109,7 @@ static inline BlockAIOCB *null_aio_common(BlockDriverState *bs,
static BlockAIOCB *null_aio_readv(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov,
int nb_sectors,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque)
{
return null_aio_common(bs, cb, opaque);
Expand All @@ -118,14 +118,14 @@ static BlockAIOCB *null_aio_readv(BlockDriverState *bs,
static BlockAIOCB *null_aio_writev(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov,
int nb_sectors,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque)
{
return null_aio_common(bs, cb, opaque);
}

static BlockAIOCB *null_aio_flush(BlockDriverState *bs,
BlockDriverCompletionFunc *cb,
BlockCompletionFunc *cb,
void *opaque)
{
return null_aio_common(bs, cb, opaque);
Expand Down
4 changes: 2 additions & 2 deletions block/qed-gencb.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "qed.h"

void *gencb_alloc(size_t len, BlockDriverCompletionFunc *cb, void *opaque)
void *gencb_alloc(size_t len, BlockCompletionFunc *cb, void *opaque)
{
GenericCB *gencb = g_malloc(len);
gencb->cb = cb;
Expand All @@ -24,7 +24,7 @@ void *gencb_alloc(size_t len, BlockDriverCompletionFunc *cb, void *opaque)
void gencb_complete(void *opaque, int ret)
{
GenericCB *gencb = opaque;
BlockDriverCompletionFunc *cb = gencb->cb;
BlockCompletionFunc *cb = gencb->cb;
void *user_opaque = gencb->opaque;

g_free(gencb);
Expand Down
Loading

0 comments on commit 097310b

Please sign in to comment.