}
auto req = io::ImageDispatchSpec::create_discard(
- image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len,
+ image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}},
discard_granularity_bytes, image_ctx.get_data_io_context(), trace);
req->send();
}
}
auto req = io::ImageDispatchSpec::create_write_same(
- image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len,
+ image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}},
std::move(bl), image_ctx.get_data_io_context(), op_flags, trace);
req->send();
}
bl.append_zero(data_length);
auto req = io::ImageDispatchSpec::create_write_same(
- image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len,
+ image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}},
std::move(bl), image_ctx.get_data_io_context(), op_flags, trace);
req->send();
return;
write_same_ctx, &image_ctx, io::AIO_TYPE_WRITESAME);
auto req = io::ImageDispatchSpec::create_write_same(
image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, write_same_aio_comp,
- write_same_offset, write_same_length, std::move(bl),
+ {{write_same_offset, write_same_length}}, std::move(bl),
image_ctx.get_data_io_context(), op_flags, trace);
req->send();
return;
uint32_t discard_granularity_bytes = 0;
auto req = io::ImageDispatchSpec::create_discard(
- image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, off, len,
+ image_ctx, io::IMAGE_DISPATCH_LAYER_API_START, aio_comp, {{off, len}},
discard_granularity_bytes, image_ctx.get_data_io_context(), trace);
req->send();
}
on_finish, image_ctx, io::AIO_TYPE_DISCARD);
ZTracer::Trace trace;
auto req = io::ImageDispatchSpec::create_discard(
- *image_ctx, io::IMAGE_DISPATCH_LAYER_WRITEBACK_CACHE, aio_comp, offset,
- length, discard_granularity_bytes,
+ *image_ctx, io::IMAGE_DISPATCH_LAYER_WRITEBACK_CACHE, aio_comp,
+ {{offset, length}}, discard_granularity_bytes,
image_ctx->get_data_io_context(), trace);
req->send();
}
on_finish, image_ctx, io::AIO_TYPE_WRITESAME);
ZTracer::Trace trace;
auto req = io::ImageDispatchSpec::create_write_same(
- *image_ctx, io::IMAGE_DISPATCH_LAYER_WRITEBACK_CACHE, aio_comp, offset,
- length, std::move(bl), image_ctx->get_data_io_context(),
+ *image_ctx, io::IMAGE_DISPATCH_LAYER_WRITEBACK_CACHE, aio_comp,
+ {{offset, length}}, std::move(bl), image_ctx->get_data_io_context(),
fadvise_flags, trace);
req->send();
}
template <typename ImageCtxT = ImageCtx>
static ImageDispatchSpec* create_discard(
ImageCtxT &image_ctx, ImageDispatchLayer image_dispatch_layer,
- AioCompletion *aio_comp, uint64_t off, uint64_t len,
+ AioCompletion *aio_comp, Extents &&image_extents,
uint32_t discard_granularity_bytes, IOContext io_context,
const ZTracer::Trace &parent_trace) {
return new ImageDispatchSpec(image_ctx.io_image_dispatcher,
- image_dispatch_layer, aio_comp, {{off, len}},
+ image_dispatch_layer, aio_comp,
+ std::move(image_extents),
Discard{discard_granularity_bytes},
io_context, 0, parent_trace);
}
template <typename ImageCtxT = ImageCtx>
static ImageDispatchSpec* create_write_same(
ImageCtxT &image_ctx, ImageDispatchLayer image_dispatch_layer,
- AioCompletion *aio_comp, uint64_t off, uint64_t len,
+ AioCompletion *aio_comp, Extents &&image_extents,
bufferlist &&bl, IOContext io_context, int op_flags,
const ZTracer::Trace &parent_trace) {
return new ImageDispatchSpec(image_ctx.io_image_dispatcher,
image_dispatch_layer, aio_comp,
- {{off, len}}, WriteSame{std::move(bl)},
+ std::move(image_extents),
+ WriteSame{std::move(bl)},
io_context, op_flags, parent_trace);
}