Descriptor for an IO operation. More...
#include <I_VIO.h>
Public Types | |
enum | { NONE = 0, READ, WRITE, CLOSE, ABORT, SHUTDOWN_READ, SHUTDOWN_WRITE, SHUTDOWN_READWRITE, SEEK, PREAD, PWRITE, STAT } |
Public Member Functions | |
~VIO () | |
Continuation * | get_continuation () |
Interface for the VConnection that owns this handle. | |
void | set_continuation (Continuation *cont) |
void | done () |
Set nbytes to be what is current available. | |
int64_t | ntodo () |
Determine the number of bytes remaining. | |
void | set_writer (MIOBuffer *writer) |
void | set_reader (IOBufferReader *reader) |
MIOBuffer * | get_writer () |
IOBufferReader * | get_reader () |
inkcoreapi void | reenable () |
Reenable the IO operation. | |
inkcoreapi void | reenable_re () |
Reenable the IO operation. | |
VIO (int aop) | |
VIO () | |
Data Fields | |
Continuation * | _cont |
Continuation to callback. | |
int64_t | nbytes |
Number of bytes to be done for this operation. | |
int64_t | ndone |
Number of bytes already completed. | |
int | op |
Type of operation. | |
MIOBufferAccessor | buffer |
Provides access to the reader or writer for this operation. | |
VConnection * | vc_server |
Internal backpointer to the VConnection for use in the reenable functions. | |
Ptr< ProxyMutex > | mutex |
Reference to the state machine's mutex. |
Descriptor for an IO operation.
A VIO is a descriptor for an in progress IO operation. It is returned from do_io_read() and do_io_write() methods on VConnections. Through the VIO, the state machine can monitor the progress of an operation and reenable the operation when data becomes available.
The VIO operation represents several types of operations, and they can be identified through the 'op' member. It can take any of the following values:
Constant | Meaning |
READ | The VIO represents a read operation |
WRITE | The VIO represents a write operation |
CLOSE | The VIO represents the request to close the VConnection |
ABORT | |
SHUTDOWN_READ | |
SHUTDOWN_WRITE | |
SHUTDOWN_READWRITE | |
SEEK | |
PREAD | |
PWRITE | |
STAT |
Definition at line 73 of file I_VIO.h.
anonymous enum |
TS_INLINE void VIO::done | ( | ) |
Set nbytes to be what is current available.
Interface to set nbytes to be ndone + buffer.reader()->read_avail() if a reader is set.
Definition at line 87 of file P_VIO.h.
References buffer, nbytes, ndone, IOBufferReader::read_avail(), and MIOBufferAccessor::reader().
TS_INLINE Continuation * VIO::get_continuation | ( | ) |
Interface for the VConnection that owns this handle.
Definition at line 57 of file P_VIO.h.
References _cont.
TS_INLINE IOBufferReader * VIO::get_reader | ( | ) |
Definition at line 77 of file P_VIO.h.
References buffer, and MIOBufferAccessor::reader().
Referenced by TransformVConnection::backlog(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), RangeTransform::transform_to_range(), and TSVIOReaderGet().
TS_INLINE MIOBuffer * VIO::get_writer | ( | ) |
Definition at line 72 of file P_VIO.h.
References buffer, and MIOBufferAccessor::writer().
Referenced by TransformTerminus::handle_event(), and TSVIOBufferGet().
TS_INLINE int64_t VIO::ntodo | ( | ) |
Determine the number of bytes remaining.
Convenience function to determine how many bytes the operation has remaining.
Definition at line 82 of file P_VIO.h.
Referenced by ClusterHandler::complete_channel_read(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), OneWayMultiTunnel::init(), SSLNetVConnection::net_read_io(), CacheVC::openReadFromWriterMain(), CacheVC::openReadMain(), CacheVC::openWriteMain(), read_from_net(), ssl_read_from_net(), OneWayTunnel::startEvent(), OneWayMultiTunnel::startEvent(), RangeTransform::transform_to_range(), TSVIONTodoGet(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), and write_to_net_io().
TS_INLINE void VIO::reenable | ( | ) |
Reenable the IO operation.
Interface that the state machine uses to reenable an I/O operation. Reenable tells the VConnection that more data is available for the operation and that it should try to continue the operation in progress. I/O operations become disabled when they can make no forward progress. For a read this means that it's buffer is full. For a write, that it's buffer is empty. If reenable is called and progress is still not possible, it is ignored and no events are generated. However, unnecessary reenables (ones where no progress can be made) should be avoided as they hurt system throughput and waste CPU.
Definition at line 121 of file P_VIO.h.
References VConnection::reenable(), and vc_server.
Referenced by KeepAliveConn::append(), HttpTunnel::consumer_handler(), HttpTunnel::consumer_reenable(), UnixNetVConnection::do_io_read(), UnixNetVConnection::do_io_write(), ClusterState::doIO_write_event(), CacheTestSM::event_handler(), FetchSM::ext_read_data(), FetchSM::ext_write_data(), RangeTransform::handle_event(), NullTransform::handle_event(), PrefetchTransform::handle_event(), CacheContinuation::handleDisposeEvent(), ObjectReloadCont::ObjectReloadEvent(), FetchSM::process_fetch_read(), HttpTunnel::producer_handler(), NetVCTest::read_handler(), OneWayTunnel::reenable_all(), OneWayMultiTunnel::reenable_all(), OneWayTunnel::startEvent(), OneWayMultiTunnel::startEvent(), HttpSM::state_read_client_request_header(), HttpSM::state_read_push_response_header(), HttpSM::state_read_server_response_header(), HttpSM::state_send_server_request_header(), RangeTransform::transform_to_range(), TSVIOReenable(), and NetVCTest::write_handler().
TS_INLINE void VIO::reenable_re | ( | ) |
Reenable the IO operation.
Interface that the state machine uses to reenable an I/O operation. Reenable tells the VConnection that more data is available for the operation and that it should try to continue the operation in progress. I/O operations become disabled when they can make no forward progress. For a read this means that it's buffer is full. For a write, that it's buffer is empty. If reenable is called and progress is still not possible, it is ignored and no events are generated. However, unnecessary reenables (ones where no progress can be made) should be avoided as they hurt system throughput and waste CPU.
Definition at line 133 of file P_VIO.h.
References VConnection::reenable_re(), and vc_server.
Referenced by ClusterState::doIO_write_event(), and CacheContinuation::handleDisposeEvent().
TS_INLINE void VIO::set_continuation | ( | Continuation * | cont | ) |
Definition at line 101 of file P_VIO.h.
References _cont, Continuation::mutex, mutex, VConnection::set_continuation(), and vc_server.
Referenced by INKVConnInternal::destroy(), CacheVC::do_io_pread(), TransformTerminus::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), TransformTerminus::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), INKVConnInternal::handle_event(), OneWayTunnel::init(), OneWayMultiTunnel::init(), and TransformVConnection::~TransformVConnection().
TS_INLINE void VIO::set_reader | ( | IOBufferReader * | reader | ) |
Definition at line 67 of file P_VIO.h.
References buffer, and MIOBufferAccessor::reader_for().
TS_INLINE void VIO::set_writer | ( | MIOBuffer * | writer | ) |
Definition at line 62 of file P_VIO.h.
References buffer, and MIOBufferAccessor::writer_for().
Continuation to callback.
Used by the VConnection to store who is the continuation to call with events for this operation.
Definition at line 164 of file I_VIO.h.
Referenced by ClusterHandler::build_initial_vector(), CacheVC::calluser(), ChannelToCacheWriteVC(), ClusterHandler::cluster_signal_and_update(), ClusterHandler::cluster_signal_and_update_locked(), ClusterHandler::complete_channel_read(), UnixNetVConnection::do_io_read(), PluginVC::do_io_read(), UnixNetVConnection::do_io_write(), PluginVC::do_io_write(), get_continuation(), ClusterHandler::get_read_locks(), ClusterHandler::get_write_locks(), RangeTransform::handle_event(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), UnixNetVConnection::mainEvent(), SSLNetVConnection::net_read_io(), CacheVC::openWriteCloseDir(), print_netstate(), read_from_net(), read_signal_and_update(), set_continuation(), RangeTransform::transform_to_range(), TSVIOContGet(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), write_signal_and_update(), and write_to_net_io().
Provides access to the reader or writer for this operation.
Contains a pointer to the IOBufferReader if the operation is a write and a pointer to a MIOBuffer if the operation is a read.
Definition at line 199 of file I_VIO.h.
Referenced by TransformVConnection::backlog(), TestProxy::cacheTransRemoteToCacheFileEvent(), OneWayTunnel::close_source_vio(), OneWayTunnel::close_target_vio(), OneWayMultiTunnel::close_target_vio(), ClusterVConnection::ClusterVConnection(), UnixNetVConnection::do_io_close(), TransformTerminus::do_io_close(), INKVConnInternal::do_io_close(), ClusterVConnectionBase::do_io_close(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), TransformTerminus::do_io_read(), PluginVC::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), UnixNetVConnection::do_io_shutdown(), TransformTerminus::do_io_shutdown(), INKVConnInternal::do_io_shutdown(), UnixNetVConnection::do_io_write(), TransformTerminus::do_io_write(), PluginVC::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), ClusterState::doIO(), done(), ClusterHandler::finish_delayed_reads(), free_CacheVC(), ClusterHandler::get_read_locks(), get_reader(), get_writer(), TestProxy::gets(), CheckConnect::handle_connect(), OneWayMultiTunnel::init(), SSLNetVConnection::net_read_io(), CacheVC::openReadFromWriterMain(), CacheVC::openReadMain(), CacheVC::openWriteMain(), read_from_net(), ClusterVConnectionBase::reenable(), CacheVC::reenable(), TestProxy::sendEvent(), set_reader(), set_writer(), ssl_read_from_net(), TestProxy::startEvent(), OneWayTunnel::startEvent(), OneWayMultiTunnel::startEvent(), ClusterHandler::update_channels_partial_read(), ClusterHandler::update_channels_read(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), ClusterHandler::vc_ok_read(), ClusterHandler::vc_ok_write(), CacheContinuation::VCdataRead(), and write_to_net_io().
Reference to the state machine's mutex.
Maintains a reference to the state machine's mutex to allow processors to safely lock the operation even if the state machine has closed the VConnection and deallocated itself.
Definition at line 216 of file I_VIO.h.
Referenced by ClusterHandler::build_initial_vector(), ClusterHandler::close_ClusterVConnection(), ClusterHandler::close_free_lock(), ClusterHandler::complete_channel_read(), UnixNetVConnection::do_io_read(), PluginVC::do_io_read(), UnixNetVConnection::do_io_write(), PluginVC::do_io_write(), ClusterHandler::finish_delayed_reads(), UnixNetVConnection::free(), SSLNetVConnection::free(), free_CacheVC(), ClusterHandler::free_locks(), ClusterHandler::get_read_locks(), ClusterHandler::get_write_locks(), RangeTransform::handle_event(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), PluginVC::main_handler(), UnixNetVConnection::mainEvent(), SSLNetVConnection::net_read_io(), print_netstate(), ClusterHandler::protoZombieEvent(), read_from_net(), UnixNetVConnection::reenable(), PluginVC::reenable(), CacheVC::reenable(), UnixNetVConnection::reenable_re(), PluginVC::reenable_re(), CacheVC::reenable_re(), UnixNetVConnection::set_active_timeout(), set_continuation(), UnixNetVConnection::set_enabled(), UnixNetVConnection::set_inactivity_timeout(), TSVIOMutexGet(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), and write_to_net_io().
int64_t VIO::nbytes |
Number of bytes to be done for this operation.
The total number of bytes this operation must complete.
Definition at line 172 of file I_VIO.h.
Referenced by ClusterHandler::build_write_descriptors(), ClusterHandler::compute_active_channels(), UnixNetVConnection::do_io_close(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), TransformTerminus::do_io_read(), PluginVC::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), UnixNetVConnection::do_io_shutdown(), UnixNetVConnection::do_io_write(), TransformTerminus::do_io_write(), PluginVC::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), ClusterState::doIO(), ClusterState::doIO_read_event(), ClusterState::doIO_write_event(), done(), CheckConnect::handle_connect(), RangeTransform::handle_event(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), HttpSM::handle_server_setup_error(), CacheContinuation::handleDisposeEvent(), CacheVC::handleWrite(), SocksProxy::mainEvent(), SocksEntry::mainEvent(), ntodo(), CacheVC::openReadFromWriter(), print_netstate(), ClusterHandler::remote_close(), HttpSM::setup_server_read_response_header(), CacheContinuation::setupReadBufTunnel(), OneWayTunnel::startEvent(), OneWayMultiTunnel::startEvent(), HttpSM::state_read_client_request_header(), HttpSM::state_read_push_response_header(), HttpSM::state_read_server_response_header(), HttpSM::state_watch_for_client_abort(), RangeTransform::transform_to_range(), TSVIONBytesGet(), TSVIONBytesSet(), and HttpSM::tunnel_handler_transform_read().
int64_t VIO::ndone |
Number of bytes already completed.
The number of bytes that already have been completed for the operation. Processor can update this value only if they hold the lock.
Definition at line 182 of file I_VIO.h.
Referenced by ClusterHandler::build_write_descriptors(), HttpTunnel::chain_abort_all(), CacheTestSM::check_buffer(), HttpTunnel::close_vc(), ClusterHandler::complete_channel_read(), ClusterHandler::compute_active_channels(), HttpTunnel::consumer_handler(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), TransformTerminus::do_io_read(), PluginVC::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), UnixNetVConnection::do_io_write(), TransformTerminus::do_io_write(), PluginVC::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), ClusterState::doIO(), ClusterState::doIO_read_event(), ClusterState::doIO_write_event(), done(), CacheTestSM::event_handler(), CacheTestSM::fill_buffer(), RangeTransform::handle_event(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), HttpSM::handle_server_setup_error(), CacheVC::handleReadDone(), CacheVC::handleWrite(), SocksProxy::mainEvent(), SocksEntry::mainEvent(), ntodo(), CacheVC::openReadFromWriterMain(), CacheVC::openReadMain(), CacheVC::openReadReadDone(), CacheVC::openWriteMain(), print_netstate(), HttpTunnel::producer_handler(), NetVCTest::read_finished(), read_from_net(), ClusterHandler::remote_close(), HttpSM::setup_server_read_response_header(), CacheContinuation::setupReadBufTunnel(), ssl_read_from_net(), OneWayTunnel::startEvent(), OneWayMultiTunnel::startEvent(), HttpSM::state_read_client_request_header(), HttpSM::state_read_push_response_header(), HttpSM::state_read_server_response_header(), HttpSM::state_watch_for_client_abort(), TSVIONDoneGet(), TSVIONDoneSet(), ClusterHandler::update_channels_written(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), CacheContinuation::VCdataRead(), NetVCTest::write_finished(), NetVCTest::write_handler(), and write_to_net_io().
int VIO::op |
Type of operation.
The type of operation that this VIO represents.
Definition at line 190 of file I_VIO.h.
Referenced by ChannelToCacheWriteVC(), CacheVC::die(), UnixNetVConnection::do_io_close(), TransformTerminus::do_io_close(), INKVConnInternal::do_io_close(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), TransformTerminus::do_io_read(), PluginVC::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), TransformTerminus::do_io_shutdown(), INKVConnInternal::do_io_shutdown(), UnixNetVConnection::do_io_write(), TransformTerminus::do_io_write(), PluginVC::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), CacheVC::do_read_call(), free_CacheVC(), CheckConnect::handle_connect(), RangeTransform::handle_event(), NullTransform::handle_event(), TransformTerminus::handle_event(), PrefetchTransform::handle_event(), CacheVC::handleReadDone(), CacheVC::is_ram_cache_hit(), Cache::lookup(), UnixNetVConnection::mainEvent(), SSLNetVConnection::net_read_io(), Cache::open_read(), Cache::open_write(), CacheVC::openReadStartEarliest(), print_netstate(), ClusterHandler::protoZombieEvent(), read_from_net(), PluginVC::reenable(), CacheVC::reenable(), PluginVC::reenable_re(), ClusterHandler::remote_close(), Cache::remove(), ClusterVConnection::set_disk_io_priority(), ClusterVConnection::set_http_info(), ClusterVConnection::set_pin_in_cache(), CacheVC::set_pin_in_cache(), ClusterHandler::valid_for_data_write(), ClusterHandler::valid_for_freespace_write(), ClusterHandler::vc_ok_read(), ClusterHandler::vc_ok_write(), and write_to_net_io().
Internal backpointer to the VConnection for use in the reenable functions.
Definition at line 206 of file I_VIO.h.
Referenced by CacheVC::callcont(), ChannelToCacheWriteVC(), OneWayTunnel::close_source_vio(), OneWayTunnel::close_target_vio(), OneWayMultiTunnel::close_target_vio(), CacheVC::do_io_pread(), UnixNetVConnection::do_io_read(), TransformTerminus::do_io_read(), PluginVC::do_io_read(), INKVConnInternal::do_io_read(), ClusterVConnectionBase::do_io_read(), CacheVC::do_io_read(), UnixNetVConnection::do_io_write(), TransformTerminus::do_io_write(), PluginVC::do_io_write(), INKVConnInternal::do_io_write(), ClusterVConnectionBase::do_io_write(), CacheVC::do_io_write(), CacheContinuation::handleDisposeEvent(), SSLNextProtocolTrampoline::ioCompletionEvent(), ProtocolProbeTrampoline::ioCompletionEvent(), print_netstate(), reenable(), reenable_re(), set_continuation(), TestProxy::startEvent(), TSVIOVConnGet(), and CacheContinuation::VCdataRead().