Addressed review comments

This commit is contained in:
sfc-gh-tclinkenbeard 2021-05-03 15:26:27 -07:00
parent e5d6c5ed17
commit d56906cd54
1 changed files with 3 additions and 2 deletions

View File

@ -85,6 +85,7 @@ public:
ACTOR static Future<Void> write(AsyncFileEncrypted* self, void const* data, int length, int64_t offset) { ACTOR static Future<Void> write(AsyncFileEncrypted* self, void const* data, int length, int64_t offset) {
ASSERT(self->canWrite); ASSERT(self->canWrite);
// All writes must append to the end of the file:
ASSERT(offset == self->currentBlock * FLOW_KNOBS->ENCRYPTION_BLOCK_SIZE + self->offsetInBlock); ASSERT(offset == self->currentBlock * FLOW_KNOBS->ENCRYPTION_BLOCK_SIZE + self->offsetInBlock);
state unsigned char const* input = reinterpret_cast<unsigned char const*>(data); state unsigned char const* input = reinterpret_cast<unsigned char const*>(data);
while (length > 0) { while (length > 0) {
@ -176,12 +177,12 @@ std::string AsyncFileEncrypted::getFilename() const {
} }
Future<Void> AsyncFileEncrypted::readZeroCopy(void** data, int* length, int64_t offset) { Future<Void> AsyncFileEncrypted::readZeroCopy(void** data, int* length, int64_t offset) {
ASSERT(false); // Not implemented throw io_error();
return Void(); return Void();
} }
void AsyncFileEncrypted::releaseZeroCopy(void* data, int length, int64_t offset) { void AsyncFileEncrypted::releaseZeroCopy(void* data, int length, int64_t offset) {
ASSERT(false); // Not implemented throw io_error();
} }
int64_t AsyncFileEncrypted::debugFD() const { int64_t AsyncFileEncrypted::debugFD() const {