mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
Fix build
This commit is contained in:
parent
10752dd1cf
commit
1974ed9d5c
@ -109,6 +109,7 @@ bool ReadBufferFromFileDescriptor::nextImpl()
|
||||
|
||||
void ReadBufferFromFileDescriptor::prefetch()
|
||||
{
|
||||
#if defined(POSIX_FADV_WILLNEED)
|
||||
/// For direct IO, loading data into page cache is pointless.
|
||||
if (required_alignment)
|
||||
return;
|
||||
@ -116,6 +117,7 @@ void ReadBufferFromFileDescriptor::prefetch()
|
||||
/// Ask OS to prefetch data into page cache.
|
||||
if (0 != posix_fadvise(fd, file_offset_of_buffer_end, internal_buffer.size(), POSIX_FADV_WILLNEED))
|
||||
throwFromErrno("Cannot posix_fadvise", ErrorCodes::CANNOT_ADVISE);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,9 +33,11 @@ private:
|
||||
public:
|
||||
RequestID submit(Request request) override
|
||||
{
|
||||
#if defined(POSIX_FADV_WILLNEED)
|
||||
int fd = assert_cast<const LocalFileDescriptor &>(*request.descriptor).fd;
|
||||
if (0 != posix_fadvise(fd, request.offset, request.size, POSIX_FADV_WILLNEED))
|
||||
throwFromErrno("Cannot posix_fadvise", ErrorCodes::CANNOT_ADVISE);
|
||||
#endif
|
||||
|
||||
std::lock_guard lock(mutex);
|
||||
++counter;
|
||||
|
Loading…
Reference in New Issue
Block a user