1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 21:35:06 +00:00

Revert "Kernel: Change Ext2FS to be backed by a file instead of a block device"

This reverts commit 6b59311d4b.

Reverting these changes since they broke things.
Fixes #1608.
This commit is contained in:
Andreas Kling 2020-04-03 21:20:51 +02:00
parent 9ae3cced76
commit c2a8bbcb59
10 changed files with 90 additions and 116 deletions

View file

@ -98,6 +98,13 @@ off_t FileDescription::seek(off_t offset, int whence)
if (!m_file->is_seekable())
return -EINVAL;
auto metadata = this->metadata();
if (!metadata.is_valid())
return -EIO;
if (metadata.is_socket() || metadata.is_fifo())
return -ESPIPE;
off_t new_offset;
switch (whence) {
@ -108,9 +115,7 @@ off_t FileDescription::seek(off_t offset, int whence)
new_offset = m_current_offset + offset;
break;
case SEEK_END:
if (!metadata().is_valid())
return -EIO;
new_offset = metadata().size;
new_offset = metadata.size;
break;
default:
return -EINVAL;