提交 51bdfae0 编写于 作者: C Cheng Chang 提交者: Facebook GitHub Bot

Check alignment of MultiRead requests in direct IO mode (#6739)

Summary:
Add assertions to check direct IO's alignment requirements in MultiRead.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6739

Test Plan: make check

Reviewed By: siying

Differential Revision: D21143825

Pulled By: cheng-chang

fbshipit-source-id: 26f1623b062a1851080771128feac0669a61f5e9
上级 bc51e33d
......@@ -608,6 +608,15 @@ IOStatus PosixRandomAccessFile::MultiRead(FSReadRequest* reqs,
size_t num_reqs,
const IOOptions& options,
IODebugContext* dbg) {
if (use_direct_io()) {
for (size_t i = 0; i < num_reqs; i++) {
const FSReadRequest& r = reqs[i];
assert(IsSectorAligned(r.offset, GetRequiredBufferAlignment()));
assert(IsSectorAligned(r.len, GetRequiredBufferAlignment()));
assert(IsSectorAligned(r.scratch, GetRequiredBufferAlignment()));
}
}
#if defined(ROCKSDB_IOURING_PRESENT)
struct io_uring* iu = nullptr;
if (thread_local_io_urings_) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册