gluster.c (4359255ad39fdf116f0cf70a77ef5330c217e4da) gluster.c (061ca8a368165fae300748c17971824a089f521f)
1/*
2 * GlusterFS backend for QEMU
3 *
4 * Copyright (C) 2012 Bharata B Rao <bharata@linux.vnet.ibm.com>
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 *

--- 1163 unchanged lines hidden (view full) ---

1172 if (ret < 0) {
1173 return -errno;
1174 }
1175
1176 qemu_coroutine_yield();
1177 return acb.ret;
1178}
1179
1/*
2 * GlusterFS backend for QEMU
3 *
4 * Copyright (C) 2012 Bharata B Rao <bharata@linux.vnet.ibm.com>
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 *

--- 1163 unchanged lines hidden (view full) ---

1172 if (ret < 0) {
1173 return -errno;
1174 }
1175
1176 qemu_coroutine_yield();
1177 return acb.ret;
1178}
1179
1180static int qemu_gluster_truncate(BlockDriverState *bs, int64_t offset,
1181 PreallocMode prealloc, Error **errp)
1180static coroutine_fn int qemu_gluster_co_truncate(BlockDriverState *bs,
1181 int64_t offset,
1182 PreallocMode prealloc,
1183 Error **errp)
1182{
1183 BDRVGlusterState *s = bs->opaque;
1184 return qemu_gluster_do_truncate(s->fd, offset, prealloc, errp);
1185}
1186
1187static coroutine_fn int qemu_gluster_co_readv(BlockDriverState *bs,
1188 int64_t sector_num,
1189 int nb_sectors,

--- 304 unchanged lines hidden (view full) ---

1494 .bdrv_reopen_prepare = qemu_gluster_reopen_prepare,
1495 .bdrv_reopen_commit = qemu_gluster_reopen_commit,
1496 .bdrv_reopen_abort = qemu_gluster_reopen_abort,
1497 .bdrv_close = qemu_gluster_close,
1498 .bdrv_co_create = qemu_gluster_co_create,
1499 .bdrv_co_create_opts = qemu_gluster_co_create_opts,
1500 .bdrv_getlength = qemu_gluster_getlength,
1501 .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
1184{
1185 BDRVGlusterState *s = bs->opaque;
1186 return qemu_gluster_do_truncate(s->fd, offset, prealloc, errp);
1187}
1188
1189static coroutine_fn int qemu_gluster_co_readv(BlockDriverState *bs,
1190 int64_t sector_num,
1191 int nb_sectors,

--- 304 unchanged lines hidden (view full) ---

1496 .bdrv_reopen_prepare = qemu_gluster_reopen_prepare,
1497 .bdrv_reopen_commit = qemu_gluster_reopen_commit,
1498 .bdrv_reopen_abort = qemu_gluster_reopen_abort,
1499 .bdrv_close = qemu_gluster_close,
1500 .bdrv_co_create = qemu_gluster_co_create,
1501 .bdrv_co_create_opts = qemu_gluster_co_create_opts,
1502 .bdrv_getlength = qemu_gluster_getlength,
1503 .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
1502 .bdrv_truncate = qemu_gluster_truncate,
1504 .bdrv_co_truncate = qemu_gluster_co_truncate,
1503 .bdrv_co_readv = qemu_gluster_co_readv,
1504 .bdrv_co_writev = qemu_gluster_co_writev,
1505 .bdrv_co_flush_to_disk = qemu_gluster_co_flush_to_disk,
1506 .bdrv_has_zero_init = qemu_gluster_has_zero_init,
1507#ifdef CONFIG_GLUSTERFS_DISCARD
1508 .bdrv_co_pdiscard = qemu_gluster_co_pdiscard,
1509#endif
1510#ifdef CONFIG_GLUSTERFS_ZEROFILL

--- 12 unchanged lines hidden (view full) ---

1523 .bdrv_reopen_prepare = qemu_gluster_reopen_prepare,
1524 .bdrv_reopen_commit = qemu_gluster_reopen_commit,
1525 .bdrv_reopen_abort = qemu_gluster_reopen_abort,
1526 .bdrv_close = qemu_gluster_close,
1527 .bdrv_co_create = qemu_gluster_co_create,
1528 .bdrv_co_create_opts = qemu_gluster_co_create_opts,
1529 .bdrv_getlength = qemu_gluster_getlength,
1530 .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
1505 .bdrv_co_readv = qemu_gluster_co_readv,
1506 .bdrv_co_writev = qemu_gluster_co_writev,
1507 .bdrv_co_flush_to_disk = qemu_gluster_co_flush_to_disk,
1508 .bdrv_has_zero_init = qemu_gluster_has_zero_init,
1509#ifdef CONFIG_GLUSTERFS_DISCARD
1510 .bdrv_co_pdiscard = qemu_gluster_co_pdiscard,
1511#endif
1512#ifdef CONFIG_GLUSTERFS_ZEROFILL

--- 12 unchanged lines hidden (view full) ---

1525 .bdrv_reopen_prepare = qemu_gluster_reopen_prepare,
1526 .bdrv_reopen_commit = qemu_gluster_reopen_commit,
1527 .bdrv_reopen_abort = qemu_gluster_reopen_abort,
1528 .bdrv_close = qemu_gluster_close,
1529 .bdrv_co_create = qemu_gluster_co_create,
1530 .bdrv_co_create_opts = qemu_gluster_co_create_opts,
1531 .bdrv_getlength = qemu_gluster_getlength,
1532 .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
1531 .bdrv_truncate = qemu_gluster_truncate,
1533 .bdrv_co_truncate = qemu_gluster_co_truncate,
1532 .bdrv_co_readv = qemu_gluster_co_readv,
1533 .bdrv_co_writev = qemu_gluster_co_writev,
1534 .bdrv_co_flush_to_disk = qemu_gluster_co_flush_to_disk,
1535 .bdrv_has_zero_init = qemu_gluster_has_zero_init,
1536#ifdef CONFIG_GLUSTERFS_DISCARD
1537 .bdrv_co_pdiscard = qemu_gluster_co_pdiscard,
1538#endif
1539#ifdef CONFIG_GLUSTERFS_ZEROFILL

--- 12 unchanged lines hidden (view full) ---

1552 .bdrv_reopen_prepare = qemu_gluster_reopen_prepare,
1553 .bdrv_reopen_commit = qemu_gluster_reopen_commit,
1554 .bdrv_reopen_abort = qemu_gluster_reopen_abort,
1555 .bdrv_close = qemu_gluster_close,
1556 .bdrv_co_create = qemu_gluster_co_create,
1557 .bdrv_co_create_opts = qemu_gluster_co_create_opts,
1558 .bdrv_getlength = qemu_gluster_getlength,
1559 .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
1534 .bdrv_co_readv = qemu_gluster_co_readv,
1535 .bdrv_co_writev = qemu_gluster_co_writev,
1536 .bdrv_co_flush_to_disk = qemu_gluster_co_flush_to_disk,
1537 .bdrv_has_zero_init = qemu_gluster_has_zero_init,
1538#ifdef CONFIG_GLUSTERFS_DISCARD
1539 .bdrv_co_pdiscard = qemu_gluster_co_pdiscard,
1540#endif
1541#ifdef CONFIG_GLUSTERFS_ZEROFILL

--- 12 unchanged lines hidden (view full) ---

1554 .bdrv_reopen_prepare = qemu_gluster_reopen_prepare,
1555 .bdrv_reopen_commit = qemu_gluster_reopen_commit,
1556 .bdrv_reopen_abort = qemu_gluster_reopen_abort,
1557 .bdrv_close = qemu_gluster_close,
1558 .bdrv_co_create = qemu_gluster_co_create,
1559 .bdrv_co_create_opts = qemu_gluster_co_create_opts,
1560 .bdrv_getlength = qemu_gluster_getlength,
1561 .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
1560 .bdrv_truncate = qemu_gluster_truncate,
1562 .bdrv_co_truncate = qemu_gluster_co_truncate,
1561 .bdrv_co_readv = qemu_gluster_co_readv,
1562 .bdrv_co_writev = qemu_gluster_co_writev,
1563 .bdrv_co_flush_to_disk = qemu_gluster_co_flush_to_disk,
1564 .bdrv_has_zero_init = qemu_gluster_has_zero_init,
1565#ifdef CONFIG_GLUSTERFS_DISCARD
1566 .bdrv_co_pdiscard = qemu_gluster_co_pdiscard,
1567#endif
1568#ifdef CONFIG_GLUSTERFS_ZEROFILL

--- 18 unchanged lines hidden (view full) ---

1587 .bdrv_reopen_prepare = qemu_gluster_reopen_prepare,
1588 .bdrv_reopen_commit = qemu_gluster_reopen_commit,
1589 .bdrv_reopen_abort = qemu_gluster_reopen_abort,
1590 .bdrv_close = qemu_gluster_close,
1591 .bdrv_co_create = qemu_gluster_co_create,
1592 .bdrv_co_create_opts = qemu_gluster_co_create_opts,
1593 .bdrv_getlength = qemu_gluster_getlength,
1594 .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
1563 .bdrv_co_readv = qemu_gluster_co_readv,
1564 .bdrv_co_writev = qemu_gluster_co_writev,
1565 .bdrv_co_flush_to_disk = qemu_gluster_co_flush_to_disk,
1566 .bdrv_has_zero_init = qemu_gluster_has_zero_init,
1567#ifdef CONFIG_GLUSTERFS_DISCARD
1568 .bdrv_co_pdiscard = qemu_gluster_co_pdiscard,
1569#endif
1570#ifdef CONFIG_GLUSTERFS_ZEROFILL

--- 18 unchanged lines hidden (view full) ---

1589 .bdrv_reopen_prepare = qemu_gluster_reopen_prepare,
1590 .bdrv_reopen_commit = qemu_gluster_reopen_commit,
1591 .bdrv_reopen_abort = qemu_gluster_reopen_abort,
1592 .bdrv_close = qemu_gluster_close,
1593 .bdrv_co_create = qemu_gluster_co_create,
1594 .bdrv_co_create_opts = qemu_gluster_co_create_opts,
1595 .bdrv_getlength = qemu_gluster_getlength,
1596 .bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
1595 .bdrv_truncate = qemu_gluster_truncate,
1597 .bdrv_co_truncate = qemu_gluster_co_truncate,
1596 .bdrv_co_readv = qemu_gluster_co_readv,
1597 .bdrv_co_writev = qemu_gluster_co_writev,
1598 .bdrv_co_flush_to_disk = qemu_gluster_co_flush_to_disk,
1599 .bdrv_has_zero_init = qemu_gluster_has_zero_init,
1600#ifdef CONFIG_GLUSTERFS_DISCARD
1601 .bdrv_co_pdiscard = qemu_gluster_co_pdiscard,
1602#endif
1603#ifdef CONFIG_GLUSTERFS_ZEROFILL

--- 15 unchanged lines hidden ---
1598 .bdrv_co_readv = qemu_gluster_co_readv,
1599 .bdrv_co_writev = qemu_gluster_co_writev,
1600 .bdrv_co_flush_to_disk = qemu_gluster_co_flush_to_disk,
1601 .bdrv_has_zero_init = qemu_gluster_has_zero_init,
1602#ifdef CONFIG_GLUSTERFS_DISCARD
1603 .bdrv_co_pdiscard = qemu_gluster_co_pdiscard,
1604#endif
1605#ifdef CONFIG_GLUSTERFS_ZEROFILL

--- 15 unchanged lines hidden ---