Lines Matching refs:bs
494 source = s->mirror_top_bs->backing->bs; in mirror_iteration()
688 src = mirror_top_bs->backing->bs; in mirror_exit_common()
795 bdrv_replace_node(mirror_top_bs, mirror_top_bs->backing->bs, &error_abort); in mirror_exit_common()
842 BlockDriverState *bs; in mirror_dirty_init() local
848 bs = s->mirror_top_bs->backing->bs; in mirror_dirty_init()
897 ret = bdrv_co_is_allocated_above(bs, s->base_overlay, true, offset, in mirror_dirty_init()
930 BlockDriverState *bs; in mirror_run() local
943 bs = bdrv_filter_bs(s->mirror_top_bs); in mirror_run()
951 s->bdev_length = bdrv_co_getlength(bs); in mirror_run()
1011 s->max_iov = MIN(bs->bl.max_iov, target_bs->bl.max_iov); in mirror_run()
1014 s->buf = qemu_try_blockalign(bs, s->buf_size); in mirror_run()
1120 bdrv_drained_begin(bs); in mirror_run()
1127 bdrv_drained_end(bs); in mirror_run()
1135 assert(QLIST_EMPTY(&bs->tracked_requests)); in mirror_run()
1171 bdrv_drained_begin(bs); in mirror_run()
1500 if (QLIST_FIRST(&source->bs->parents) == source && in active_write_settle()
1517 bdrv_mirror_top_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, in bdrv_mirror_top_preadv() argument
1520 return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags); in bdrv_mirror_top_preadv()
1531 bdrv_mirror_top_do_write(BlockDriverState *bs, MirrorMethod method, in bdrv_mirror_top_do_write() argument
1536 MirrorBDSOpaque *s = bs->opaque; in bdrv_mirror_top_do_write()
1545 ret = bdrv_co_pwritev(bs->backing, offset, bytes, qiov, flags); in bdrv_mirror_top_do_write()
1549 ret = bdrv_co_pwrite_zeroes(bs->backing, offset, bytes, flags); in bdrv_mirror_top_do_write()
1553 ret = bdrv_co_pdiscard(bs->backing, offset, bytes); in bdrv_mirror_top_do_write()
1581 bdrv_mirror_top_pwritev(BlockDriverState *bs, int64_t offset, int64_t bytes, in bdrv_mirror_top_pwritev() argument
1587 bool copy_to_target = should_copy_to_target(bs->opaque); in bdrv_mirror_top_pwritev()
1594 bounce_buf = qemu_blockalign(bs, bytes); in bdrv_mirror_top_pwritev()
1604 ret = bdrv_mirror_top_do_write(bs, MIRROR_METHOD_COPY, copy_to_target, in bdrv_mirror_top_pwritev()
1615 static int coroutine_fn GRAPH_RDLOCK bdrv_mirror_top_flush(BlockDriverState *bs) in bdrv_mirror_top_flush() argument
1617 if (bs->backing == NULL) { in bdrv_mirror_top_flush()
1621 return bdrv_co_flush(bs->backing->bs); in bdrv_mirror_top_flush()
1625 bdrv_mirror_top_pwrite_zeroes(BlockDriverState *bs, int64_t offset, in bdrv_mirror_top_pwrite_zeroes() argument
1628 bool copy_to_target = should_copy_to_target(bs->opaque); in bdrv_mirror_top_pwrite_zeroes()
1629 return bdrv_mirror_top_do_write(bs, MIRROR_METHOD_ZERO, copy_to_target, in bdrv_mirror_top_pwrite_zeroes()
1634 bdrv_mirror_top_pdiscard(BlockDriverState *bs, int64_t offset, int64_t bytes) in bdrv_mirror_top_pdiscard() argument
1636 bool copy_to_target = should_copy_to_target(bs->opaque); in bdrv_mirror_top_pdiscard()
1637 return bdrv_mirror_top_do_write(bs, MIRROR_METHOD_DISCARD, copy_to_target, in bdrv_mirror_top_pdiscard()
1641 static void GRAPH_RDLOCK bdrv_mirror_top_refresh_filename(BlockDriverState *bs) in bdrv_mirror_top_refresh_filename() argument
1643 if (bs->backing == NULL) { in bdrv_mirror_top_refresh_filename()
1648 pstrcpy(bs->exact_filename, sizeof(bs->exact_filename), in bdrv_mirror_top_refresh_filename()
1649 bs->backing->bs->filename); in bdrv_mirror_top_refresh_filename()
1652 static void bdrv_mirror_top_child_perm(BlockDriverState *bs, BdrvChild *c, in bdrv_mirror_top_child_perm() argument
1658 MirrorBDSOpaque *s = bs->opaque; in bdrv_mirror_top_child_perm()
1670 bdrv_default_perms(bs, c, role, reopen_queue, in bdrv_mirror_top_child_perm()
1710 const char *job_id, BlockDriverState *bs, in mirror_start_job() argument
1753 if (bdrv_skip_filters(bs) == bdrv_skip_filters(target)) { in mirror_start_job()
1759 target_is_backing = bdrv_chain_contains(bs, target); in mirror_start_job()
1777 mirror_top_bs->total_sectors = bs->total_sectors; in mirror_start_job()
1786 bdrv_drained_begin(bs); in mirror_start_job()
1787 ret = bdrv_append(mirror_top_bs, bs, errp); in mirror_start_job()
1788 bdrv_drained_end(bs); in mirror_start_job()
1825 bs_size = bdrv_getlength(bs); in mirror_start_job()
1846 if (bdrv_chain_contains(bs, bdrv_skip_filters(target))) { in mirror_start_job()
1886 s->base_overlay = bdrv_find_overlay(bs, base); in mirror_start_job()
1908 ret = block_job_add_bdrv(&s->common, "source", bs, 0, in mirror_start_job()
1931 filtered_target = bdrv_cow_bs(bdrv_find_overlay(bs, target)); in mirror_start_job()
1944 for (iter = bdrv_filter_or_cow_bs(bs); iter != target; in mirror_start_job()
1972 trace_mirror_start(bs, s, opaque); in mirror_start_job()
1993 bdrv_drained_begin(bs); in mirror_start_job()
1995 assert(mirror_top_bs->backing->bs == bs); in mirror_start_job()
1998 bdrv_replace_node(mirror_top_bs, bs, &error_abort); in mirror_start_job()
2000 bdrv_drained_end(bs); in mirror_start_job()
2007 void mirror_start(const char *job_id, BlockDriverState *bs, in mirror_start() argument
2032 base = mode == MIRROR_SYNC_MODE_TOP ? bdrv_backing_chain_next(bs) : NULL; in mirror_start()
2035 mirror_start_job(job_id, bs, creation_flags, target, replaces, in mirror_start()
2042 BlockJob *commit_active_start(const char *job_id, BlockDriverState *bs, in commit_active_start() argument
2063 job_id, bs, creation_flags, base, NULL, speed, 0, 0, in commit_active_start()