mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 06:18:59 +00:00
Kernel/FileSystem: Funnel calls to Inode::prepare_to_write_data method
Instead of requiring each FileSystem implementation to call this method when trying to write data, do the calls at 2 points to avoid further calls (or lack of them due to not remembering to use it) at other files and locations in the codebase.
This commit is contained in:
parent
38bf7863d0
commit
fcc0e4d538
Notes:
sideshowbarker
2024-07-17 20:22:04 +09:00
Author: https://github.com/supercomputer7
Commit: fcc0e4d538
Pull-request: https://github.com/SerenityOS/serenity/pull/14713
6 changed files with 12 additions and 11 deletions
|
@ -937,15 +937,12 @@ ErrorOr<void> Ext2FSInode::resize(u64 new_size)
|
|||
|
||||
ErrorOr<size_t> Ext2FSInode::write_bytes(off_t offset, size_t count, UserOrKernelBuffer const& data, OpenFileDescription* description)
|
||||
{
|
||||
VERIFY(m_inode_lock.is_locked());
|
||||
VERIFY(offset >= 0);
|
||||
|
||||
if (count == 0)
|
||||
return 0;
|
||||
|
||||
MutexLocker inode_locker(m_inode_lock);
|
||||
|
||||
TRY(prepare_to_write_data());
|
||||
|
||||
if (is_symlink()) {
|
||||
VERIFY(offset == 0);
|
||||
if (max((size_t)(offset + count), (size_t)m_raw_inode.i_size) < max_inline_symlink_length) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue