Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static const int kPageSize = 4096;
class AIORequest {
public:
int* buffer_;
struct iocb iocb_;

virtual void Complete(int res) = 0;

Expand Down Expand Up @@ -237,9 +238,9 @@ class AIOAdder : public Adder {

void SubmitWrite() {
LOG(INFO) << "Submitting a write to " << counter_;
struct iocb iocb;
struct iocb* iocbs = &iocb;
AIORequest *req = new AIOWriteRequest(counter_);
struct iocb& iocb = req->iocb_;
struct iocb* iocbs = &iocb;
io_prep_pwrite(&iocb, fd_, req->buffer_, kPageSize, counter_ * kPageSize);
iocb.data = req;
int res = io_submit(ioctx_, 1, &iocbs);
Expand All @@ -257,9 +258,9 @@ class AIOAdder : public Adder {

void SubmitRead() {
LOG(INFO) << "Submitting a read from " << counter_;
struct iocb iocb;
struct iocb* iocbs = &iocb;
AIORequest *req = new AIOReadRequest(this);
struct iocb& iocb = req->iocb_;
struct iocb* iocbs = &iocb;
io_prep_pread(&iocb, fd_, req->buffer_, kPageSize, counter_ * kPageSize);
iocb.data = req;
int res = io_submit(ioctx_, 1, &iocbs);
Expand Down