class Operation
Defined at line 69 of file ../../zircon/kernel/vm/include/vm/stream_size_manager.h
`StreamSizeManager::Operation` is a structure to ensure operations related to stream size are
committed in order. `Operation` is intended to be used as a stack-allocated structure.
Currently, an operation maps 1:1 with the thread it is executing on and thus, can be
considered owned by that thread.
Notes:
* The initialization, destruction, and immutable properties of this type are only
thread-compatible.
* The type must either be committed or cancelled before destruction. Otherwise, the destructor
will panic.
Public Methods
uint64_t GetSizeLocked ()
Gets the stream size that the operation will expand to once it is completed.
Note:
* This may only be called on a valid operation.
* This must only be called when holding the parent `StreamSizeManager` lock.
Defined at line 22 of file ../../zircon/kernel/vm/stream_size_manager.cc
void ShrinkSizeLocked (uint64_t new_size)
Shrinks the size of the operation.
Only size shrinks are allowed, since the concurrency of other operations are gated on the
largest potential size of operations in front of it.
Note:
* This may only be called on a valid operation.
* This must only be called when holding the parent `StreamSizeManager` lock.
* The `new_size` passed in must be greater than 0.
* The `new_size` passed in must be less than or equal to the current size.
* This must only be called for `OperationType::Append` and `OperationType::Write` ops.
Defined at line 30 of file ../../zircon/kernel/vm/stream_size_manager.cc
void CommitLocked ()
Commits the operation's effects on the stream size.
Note:
* This may only be called on a valid operation.
* This must only be called when holding the parent `StreamSizeManager` lock.
Defined at line 44 of file ../../zircon/kernel/vm/stream_size_manager.cc
void CancelLocked ()
Cancels the operation and does not commit any changes to the stream size.
Note:
* This may only be called on a valid operation.
* This must only be called when holding the parent `StreamSizeManager` lock.
Defined at line 50 of file ../../zircon/kernel/vm/stream_size_manager.cc
void UpdateStreamSizeFromProgress (uint64_t new_stream_size)
Updates the stream size when progress is made from the operation. Once this has been called
it is invalid to call CancelLocked or to call ShrinkSizeLocked with a size less than the
stream size provided here.
Note:
* This may only be called on a valid `Append` or `Write` operation.
* The stream size must be larger than the current stream size.
Defined at line 59 of file ../../zircon/kernel/vm/stream_size_manager.cc
void Operation (StreamSizeManager * parent)
An operation must be initialized with the StreamSizeManager it will later be used with.
Passing this here allows for easier locking as AliasedLock acquisitions can be used to
satisfy the analysis.
Defined at line 76 of file ../../zircon/kernel/vm/include/vm/stream_size_manager.h
void ~Operation ()
Defined at line 78 of file ../../zircon/kernel/vm/include/vm/stream_size_manager.h
void Operation (const Operation & )
Disallow copy and move
Defined at line 83 of file ../../zircon/kernel/vm/include/vm/stream_size_manager.h
Operation & operator= (const Operation & )
Defined at line 84 of file ../../zircon/kernel/vm/include/vm/stream_size_manager.h
void Operation (Operation && )
Defined at line 85 of file ../../zircon/kernel/vm/include/vm/stream_size_manager.h
Operation & operator= (Operation && )
Defined at line 86 of file ../../zircon/kernel/vm/include/vm/stream_size_manager.h
Lock<Mutex> * lock ()
Defined at line 88 of file ../../zircon/kernel/vm/include/vm/stream_size_manager.h
Friends
class StreamSizeManager