Commit cc650618 authored by Andrew Jeffery's avatar Andrew Jeffery

vpnor: pnor_partition: Debugging for Request.fulfil()

Change-Id: If74d8d1983c2b32b3ed6264bbdb7f49118d5a1f2
Signed-off-by: Andrew Jeffery's avatarAndrew Jeffery <andrew@aj.id.au>
parent cda29646
......@@ -134,6 +134,19 @@ size_t Request::fulfil(const fs::path &path, int flags, void *buf, size_t len)
throw std::system_error(errno, std::system_category());
}
if (flags == O_RDONLY)
{
MSG_INFO("Fulfilling read request against %s at offset 0x%zx into %p "
"for %zu\n",
path.c_str(), offset, buf, len);
}
else
{
MSG_INFO("Fulfilling write request against %s at offset 0x%zx from %p "
"for %zu\n",
path.c_str(), offset, buf, len);
}
size_t fileSize = fs::file_size(path);
int mprot = PROT_READ | ((flags == O_RDWR) ? PROT_WRITE : 0);
auto map = mmap(NULL, fileSize, mprot, MAP_SHARED, fd, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment