#include <IOUring.hpp>
|
| IOUring ()=default |
| Create and initialize an IO uring. More...
|
|
virtual | ~IOUring ()=default |
| Clean up the IO uring. More...
|
|
virtual void | submit ()=0 |
| Submit all prepared uring operations in a batch, and wait for all operations to return a result. Throws if there are errors interacting with the completion queue. Failures of batched operations are reported by ret from the operation's respective prep_... function call, and do not cause this function to throw. More...
|
|
virtual void | prep_read (std::shared_ptr< int > ret, int fd, void *buf, unsigned nbytes, off_t offset)=0 |
| Perform a pread in the next batch submission. More...
|
|
virtual void | prep_write (std::shared_ptr< int > ret, int fd, const void *buf, unsigned nbytes, off_t offset)=0 |
| Perform a pwrite in the next batch submission. More...
|
|
|
static std::unique_ptr< IOUring > | make_unique (unsigned entries) |
| Create an object that supports an io_uring-like interface. The created object uses io_uring if supported, otherwise uses individual read/write operations. More...
|
|
◆ IOUring()
geopm::IOUring::IOUring |
( |
| ) |
|
|
default |
Create and initialize an IO uring.
◆ ~IOUring()
virtual geopm::IOUring::~IOUring |
( |
| ) |
|
|
virtualdefault |
◆ make_unique()
std::unique_ptr< IOUring > geopm::IOUring::make_unique |
( |
unsigned |
entries | ) |
|
|
static |
Create an object that supports an io_uring-like interface. The created object uses io_uring if supported, otherwise uses individual read/write operations.
- Parameters
-
entries | Maximum number of queue operations to contain within a single batch submission. |
◆ prep_read()
virtual void geopm::IOUring::prep_read |
( |
std::shared_ptr< int > |
ret, |
|
|
int |
fd, |
|
|
void * |
buf, |
|
|
unsigned |
nbytes, |
|
|
off_t |
offset |
|
) |
| |
|
pure virtual |
Perform a pread in the next batch submission.
- Parameters
-
ret | Where to store the operation's return value, which will be a non-negative number of bytes read, or -errno on failure, after submit() returns. |
fd | Which already-opened file to read. |
buf | Where to store the read data. |
nbytes | Number of bytes to read into buf . |
offset | Offset within fd to start the pread. -1 uses the existing offset of fd , like in read(). |
- Exceptions
-
if | the queue is already full. |
Implemented in geopm::IOUringImp, and geopm::IOUringFallback.
◆ prep_write()
virtual void geopm::IOUring::prep_write |
( |
std::shared_ptr< int > |
ret, |
|
|
int |
fd, |
|
|
const void * |
buf, |
|
|
unsigned |
nbytes, |
|
|
off_t |
offset |
|
) |
| |
|
pure virtual |
Perform a pwrite in the next batch submission.
- Parameters
-
ret | Where to store the operation's return value, which will be a non-negative number of bytes written, or -errno on failure, after submit() returns. |
fd | Which already-opened file to write. |
buf | Which data to write to the file. |
nbytes | Number of bytes to write from buf . |
offset | Offset within fd to start the pwrite. -1 uses the existing offset of fd , like in write(). |
- Exceptions
-
if | the queue is already full. |
Implemented in geopm::IOUringImp, and geopm::IOUringFallback.
◆ submit()
virtual void geopm::IOUring::submit |
( |
| ) |
|
|
pure virtual |
Submit all prepared uring operations in a batch, and wait for all operations to return a result. Throws if there are errors interacting with the completion queue. Failures of batched operations are reported by ret
from the operation's respective prep_... function call, and do not cause this function to throw.
Implemented in geopm::IOUringImp, and geopm::IOUringFallback.
The documentation for this class was generated from the following files: