Skip to content

Commit

Permalink
block/gluster: code movement of qemu_gluster_close()
Browse files Browse the repository at this point in the history
Move qemu_gluster_close() further up in the file, in preparation
for the next patch, to avoid a forward declaration.

Signed-off-by: Jeff Cody <[email protected]>
  • Loading branch information
codyprime committed Apr 19, 2016
1 parent a882745 commit 5d4343e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions block/gluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,17 @@ static coroutine_fn int qemu_gluster_co_writev(BlockDriverState *bs,
return qemu_gluster_co_rw(bs, sector_num, nb_sectors, qiov, 1);
}

static void qemu_gluster_close(BlockDriverState *bs)
{
BDRVGlusterState *s = bs->opaque;

if (s->fd) {
glfs_close(s->fd);
s->fd = NULL;
}
glfs_fini(s->glfs);
}

static coroutine_fn int qemu_gluster_co_flush_to_disk(BlockDriverState *bs)
{
int ret;
Expand Down Expand Up @@ -661,17 +672,6 @@ static int64_t qemu_gluster_allocated_file_size(BlockDriverState *bs)
}
}

static void qemu_gluster_close(BlockDriverState *bs)
{
BDRVGlusterState *s = bs->opaque;

if (s->fd) {
glfs_close(s->fd);
s->fd = NULL;
}
glfs_fini(s->glfs);
}

static int qemu_gluster_has_zero_init(BlockDriverState *bs)
{
/* GlusterFS volume could be backed by a block device */
Expand Down

0 comments on commit 5d4343e

Please sign in to comment.