Skip to content

Commit

Permalink
Add changes matching dwrite_q review
Browse files Browse the repository at this point in the history
  • Loading branch information
yadij committed Nov 2, 2024
1 parent ced6c2d commit c9ad0c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/fs_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,7 @@ void
file_read(int fd, char *buf, int req_len, off_t offset, DRCB * handler, void *client_data)
{
assert(fd >= 0);
auto *ctrl_dat = new dread_ctrl;
ctrl_dat->fd = fd;
ctrl_dat->offset = offset;
ctrl_dat->req_len = req_len;
ctrl_dat->buf = buf;
ctrl_dat->handler = handler;
ctrl_dat->client_data = cbdataReference(client_data);
const auto ctrl_dat = new dread_ctrl(fd, offset, buf, req_len, handler, cbdataReference(client_data));
diskHandleRead(fd, ctrl_dat);
}

Expand Down
12 changes: 11 additions & 1 deletion src/fs_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ class MemBuf;
class dread_ctrl
{
MEMPROXY_CLASS(dread_ctrl);

public:
dread_ctrl(int aFd, off_t aOffset, char *aBuf, int aLen, DRCB *aHandler, void *aData) :
fd(aFd),
offset(aOffset),
req_len(aLen),
buf(aBuf),
handler(aHandler),
client_data(aData)
{}
dread_ctrl(dread_ctrl &&) = delete; // no copying or moving of any kind
~dread_ctrl() = default;

int fd = -1;
off_t offset = 0;
int req_len = 0;
Expand Down

0 comments on commit c9ad0c0

Please sign in to comment.