Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'include/afio/v2.0/detail/impl/posix')
-rw-r--r--include/afio/v2.0/detail/impl/posix/async_file_handle.ipp2
-rw-r--r--include/afio/v2.0/detail/impl/posix/file_handle.ipp6
-rw-r--r--include/afio/v2.0/detail/impl/posix/map_handle.ipp18
-rw-r--r--include/afio/v2.0/detail/impl/posix/mapped_file_handle.ipp4
4 files changed, 15 insertions, 15 deletions
diff --git a/include/afio/v2.0/detail/impl/posix/async_file_handle.ipp b/include/afio/v2.0/detail/impl/posix/async_file_handle.ipp
index 7f259a3d..e6bc0ba2 100644
--- a/include/afio/v2.0/detail/impl/posix/async_file_handle.ipp
+++ b/include/afio/v2.0/detail/impl/posix/async_file_handle.ipp
@@ -235,7 +235,7 @@ template <class BuffersType, class IORoutine> result<async_file_handle::io_state
struct aiocb *aiocb = state->aiocbs + n;
aiocb->aio_fildes = _v.fd;
aiocb->aio_offset = offset;
- aiocb->aio_buf = reinterpret_cast<void *>(const_cast<char *>(out[n].data));
+ aiocb->aio_buf = reinterpret_cast<void *>(const_cast<byte *>(out[n].data));
aiocb->aio_nbytes = out[n].len;
aiocb->aio_sigevent.sigev_notify = SIGEV_NONE;
aiocb->aio_sigevent.sigev_value.sival_ptr = reinterpret_cast<void *>(state);
diff --git a/include/afio/v2.0/detail/impl/posix/file_handle.ipp b/include/afio/v2.0/detail/impl/posix/file_handle.ipp
index 13e0e779..3b3afa98 100644
--- a/include/afio/v2.0/detail/impl/posix/file_handle.ipp
+++ b/include/afio/v2.0/detail/impl/posix/file_handle.ipp
@@ -462,7 +462,7 @@ result<file_handle::extent_type> file_handle::zero(file_handle::extent_type offs
// Fall back onto a write of zeros
if(bytes < utils::page_size())
{
- auto *buffer = static_cast<char *>(alloca(bytes));
+ auto *buffer = static_cast<byte *>(alloca(bytes));
memset(buffer, 0, bytes);
OUTCOME_TRY(written, write(offset, {{buffer, bytes}}, d));
return written[0].len;
@@ -471,8 +471,8 @@ result<file_handle::extent_type> file_handle::zero(file_handle::extent_type offs
{
extent_type ret = 0;
auto blocksize = utils::file_buffer_default_size();
- char *buffer = utils::page_allocator<char>().allocate(blocksize);
- auto unbufferh = undoer([buffer, blocksize] { utils::page_allocator<char>().deallocate(buffer, blocksize); });
+ byte *buffer = utils::page_allocator<byte>().allocate(blocksize);
+ auto unbufferh = undoer([buffer, blocksize] { utils::page_allocator<byte>().deallocate(buffer, blocksize); });
(void) unbufferh;
while(bytes > 0)
{
diff --git a/include/afio/v2.0/detail/impl/posix/map_handle.ipp b/include/afio/v2.0/detail/impl/posix/map_handle.ipp
index e5ebfebe..f4b3443a 100644
--- a/include/afio/v2.0/detail/impl/posix/map_handle.ipp
+++ b/include/afio/v2.0/detail/impl/posix/map_handle.ipp
@@ -174,7 +174,7 @@ native_handle_type map_handle::release() noexcept
map_handle::io_result<map_handle::const_buffers_type> map_handle::barrier(map_handle::io_request<map_handle::const_buffers_type> reqs, bool wait_for_device, bool and_metadata, deadline d) noexcept
{
AFIO_LOG_FUNCTION_CALL(this);
- char *addr = _addr + reqs.offset;
+ byte *addr = _addr + reqs.offset;
extent_type bytes = 0;
// Check for overflow
for(const auto &req : reqs.buffers)
@@ -293,7 +293,7 @@ result<map_handle> map_handle::map(size_type bytes, section_handle::flag _flag)
result<map_handle> ret(map_handle(nullptr));
native_handle_type &nativeh = ret.value()._v;
OUTCOME_TRY(addr, do_mmap(nativeh, nullptr, 0, nullptr, bytes, 0, _flag));
- ret.value()._addr = static_cast<char *>(addr);
+ ret.value()._addr = static_cast<byte *>(addr);
ret.value()._reservation = bytes;
ret.value()._length = bytes;
AFIO_LOG_FUNCTION_CALL(&ret);
@@ -310,7 +310,7 @@ result<map_handle> map_handle::map(section_handle &section, size_type bytes, ext
result<map_handle> ret{map_handle(&section)};
native_handle_type &nativeh = ret.value()._v;
OUTCOME_TRY(addr, do_mmap(nativeh, nullptr, 0, &section, bytes, offset, _flag));
- ret.value()._addr = static_cast<char *>(addr);
+ ret.value()._addr = static_cast<byte *>(addr);
ret.value()._offset = offset;
ret.value()._reservation = bytes;
ret.value()._length = (length - offset < bytes) ? (length - offset) : bytes; // length of backing, not reservation
@@ -348,7 +348,7 @@ result<map_handle::size_type> map_handle::truncate(size_type newsize, bool permi
if(_addr == nullptr)
{
OUTCOME_TRY(addr, do_mmap(_v, nullptr, 0, _section, newsize, _offset, _flag));
- _addr = static_cast<char *>(addr);
+ _addr = static_cast<byte *>(addr);
_reservation = newsize;
_length = (length - _offset < newsize) ? (length - _offset) : newsize; // length of backing, not reservation
return newsize;
@@ -360,7 +360,7 @@ result<map_handle::size_type> map_handle::truncate(size_type newsize, bool permi
{
return {errno, std::system_category()};
}
- _addr = static_cast<char *>(newaddr);
+ _addr = static_cast<byte *>(newaddr);
_reservation = newsize;
_length = (length - _offset < newsize) ? (length - _offset) : newsize; // length of backing, not reservation
return newsize;
@@ -368,7 +368,7 @@ result<map_handle::size_type> map_handle::truncate(size_type newsize, bool permi
if(newsize > _length)
{
#if defined(MAP_EXCL) // BSD type systems
- char *addrafter = _addr + _reservation;
+ byte *addrafter = _addr + _reservation;
size_type bytes = newsize - _reservation;
extent_type offset = _offset + _reservation;
OUTCOME_TRY(addr, do_mmap(_v, addrafter, MAP_FIXED | MAP_EXCL, _section, bytes, offset, _flag));
@@ -376,7 +376,7 @@ result<map_handle::size_type> map_handle::truncate(size_type newsize, bool permi
_length = (length - _offset < newsize) ? (length - _offset) : newsize; // length of backing, not reservation
return newsize;
#else // generic POSIX, inefficient
- char *addrafter = _addr + _reservation;
+ byte *addrafter = _addr + _reservation;
size_type bytes = newsize - _reservation;
extent_type offset = _offset + _reservation;
OUTCOME_TRY(addr, do_mmap(_v, addrafter, 0, _section, bytes, offset, _flag));
@@ -505,7 +505,7 @@ result<map_handle::buffer_type> map_handle::do_not_store(buffer_type region) noe
map_handle::io_result<map_handle::buffers_type> map_handle::read(io_request<buffers_type> reqs, deadline /*d*/) noexcept
{
AFIO_LOG_FUNCTION_CALL(this);
- char *addr = _addr + reqs.offset;
+ byte *addr = _addr + reqs.offset;
size_type togo = reqs.offset < _length ? static_cast<size_type>(_length - reqs.offset) : 0;
for(buffer_type &req : reqs.buffers)
{
@@ -530,7 +530,7 @@ map_handle::io_result<map_handle::buffers_type> map_handle::read(io_request<buff
map_handle::io_result<map_handle::const_buffers_type> map_handle::write(io_request<const_buffers_type> reqs, deadline /*d*/) noexcept
{
AFIO_LOG_FUNCTION_CALL(this);
- char *addr = _addr + reqs.offset;
+ byte *addr = _addr + reqs.offset;
size_type togo = reqs.offset < _length ? static_cast<size_type>(_length - reqs.offset) : 0;
for(const_buffer_type &req : reqs.buffers)
{
diff --git a/include/afio/v2.0/detail/impl/posix/mapped_file_handle.ipp b/include/afio/v2.0/detail/impl/posix/mapped_file_handle.ipp
index e5c10062..8999a655 100644
--- a/include/afio/v2.0/detail/impl/posix/mapped_file_handle.ipp
+++ b/include/afio/v2.0/detail/impl/posix/mapped_file_handle.ipp
@@ -116,8 +116,8 @@ result<mapped_file_handle::extent_type> mapped_file_handle::truncate(extent_type
// otherwise some kernels keep them around until last fd close, effectively leaking them
if(newsize < size)
{
- char *start = utils::round_up_to_page_size(_mh.address() + newsize);
- char *end = utils::round_up_to_page_size(_mh.address() + size);
+ byte *start = utils::round_up_to_page_size(_mh.address() + newsize);
+ byte *end = utils::round_up_to_page_size(_mh.address() + size);
(void) _mh.do_not_store({start, static_cast<size_t>(end - start)});
}
// Resize the file, on unified page cache kernels it'll map any new pages into the reserved map