| 83 | } |
| 84 | |
| 85 | void handle_read(int r) { |
| 86 | auto cct = image_ctx->cct; |
| 87 | ldout(cct, 20) << "aligned read r=" << r << dendl; |
| 88 | if (r >= 0) { |
| 89 | r = 0; |
| 90 | for (auto& extent: *extents) { |
| 91 | auto crypto_ret = crypto->decrypt_aligned_extent( |
| 92 | extent, get_file_offset(image_ctx, object_no, extent.offset)); |
| 93 | if (crypto_ret != 0) { |
| 94 | ceph_assert(crypto_ret < 0); |
| 95 | r = crypto_ret; |
| 96 | break; |
| 97 | } |
| 98 | r += extent.length; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | if (r == -ENOENT && !disable_read_from_parent) { |
| 103 | io::util::read_parent<I>( |
| 104 | image_ctx, object_no, extents, |
| 105 | io_context->get_read_snap(), |
| 106 | parent_trace, this); |
| 107 | } else { |
| 108 | complete(r); |
| 109 | } |
| 110 | } |
| 111 | }; |
| 112 | |
| 113 | template <typename I> |
nothing calls this directly
no test coverage detected