diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-17 21:17:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-17 21:17:39 +0200 |
commit | 3b805a57e6bbf5ebdda5e5622d407996ed51beaf (patch) | |
tree | 14ed571d4d4c38e4fd1b4742d4c462cc0c63d3d7 /Kernel/FileSystem/Inode.cpp | |
parent | 63e1423830794413370707420570f83b5802aa4f (diff) | |
download | serenity-3b805a57e6bbf5ebdda5e5622d407996ed51beaf.zip |
Kernel: Rename Inode::m_lock => m_inode_lock
This makes file system code much easier to read since it was hard when
both the file system and inode locks were called "m_lock".
Diffstat (limited to 'Kernel/FileSystem/Inode.cpp')
-rw-r--r-- | Kernel/FileSystem/Inode.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Kernel/FileSystem/Inode.cpp b/Kernel/FileSystem/Inode.cpp index d454400b08..0072c8848b 100644 --- a/Kernel/FileSystem/Inode.cpp +++ b/Kernel/FileSystem/Inode.cpp @@ -109,7 +109,7 @@ Inode::~Inode() void Inode::will_be_destroyed() { - Locker locker(m_lock); + Locker locker(m_inode_lock); if (m_metadata_dirty) flush_metadata(); } @@ -141,13 +141,13 @@ KResult Inode::decrement_link_count() void Inode::set_shared_vmobject(SharedInodeVMObject& vmobject) { - Locker locker(m_lock); + Locker locker(m_inode_lock); m_shared_vmobject = vmobject; } bool Inode::bind_socket(LocalSocket& socket) { - Locker locker(m_lock); + Locker locker(m_inode_lock); if (m_socket) return false; m_socket = socket; @@ -156,7 +156,7 @@ bool Inode::bind_socket(LocalSocket& socket) bool Inode::unbind_socket() { - Locker locker(m_lock); + Locker locker(m_inode_lock); if (!m_socket) return false; m_socket = nullptr; @@ -165,21 +165,21 @@ bool Inode::unbind_socket() void Inode::register_watcher(Badge<InodeWatcher>, InodeWatcher& watcher) { - Locker locker(m_lock); + Locker locker(m_inode_lock); VERIFY(!m_watchers.contains(&watcher)); m_watchers.set(&watcher); } void Inode::unregister_watcher(Badge<InodeWatcher>, InodeWatcher& watcher) { - Locker locker(m_lock); + Locker locker(m_inode_lock); VERIFY(m_watchers.contains(&watcher)); m_watchers.remove(&watcher); } NonnullRefPtr<FIFO> Inode::fifo() { - Locker locker(m_lock); + Locker locker(m_inode_lock); VERIFY(metadata().is_fifo()); // FIXME: Release m_fifo when it is closed by all readers and writers @@ -192,7 +192,7 @@ NonnullRefPtr<FIFO> Inode::fifo() void Inode::set_metadata_dirty(bool metadata_dirty) { - Locker locker(m_lock); + Locker locker(m_inode_lock); if (metadata_dirty) { // Sanity check. @@ -214,7 +214,7 @@ void Inode::set_metadata_dirty(bool metadata_dirty) void Inode::did_add_child(InodeIdentifier const&, String const& name) { - Locker locker(m_lock); + Locker locker(m_inode_lock); for (auto& watcher : m_watchers) { watcher->notify_inode_event({}, identifier(), InodeWatcherEvent::Type::ChildCreated, name); @@ -223,7 +223,7 @@ void Inode::did_add_child(InodeIdentifier const&, String const& name) void Inode::did_remove_child(InodeIdentifier const&, String const& name) { - Locker locker(m_lock); + Locker locker(m_inode_lock); if (name == "." || name == "..") { // These are just aliases and are not interesting to userspace. @@ -237,7 +237,7 @@ void Inode::did_remove_child(InodeIdentifier const&, String const& name) void Inode::did_modify_contents() { - Locker locker(m_lock); + Locker locker(m_inode_lock); for (auto& watcher : m_watchers) { watcher->notify_inode_event({}, identifier(), InodeWatcherEvent::Type::ContentModified); } @@ -245,7 +245,7 @@ void Inode::did_modify_contents() void Inode::did_delete_self() { - Locker locker(m_lock); + Locker locker(m_inode_lock); for (auto& watcher : m_watchers) { watcher->notify_inode_event({}, identifier(), InodeWatcherEvent::Type::Deleted); } @@ -255,7 +255,7 @@ KResult Inode::prepare_to_write_data() { // FIXME: It's a poor design that filesystems are expected to call this before writing out data. // We should funnel everything through an interface at the VirtualFileSystem layer so this can happen from a single place. - Locker locker(m_lock); + Locker locker(m_inode_lock); if (fs().is_readonly()) return EROFS; auto metadata = this->metadata(); @@ -268,7 +268,7 @@ KResult Inode::prepare_to_write_data() RefPtr<SharedInodeVMObject> Inode::shared_vmobject() const { - Locker locker(m_lock); + Locker locker(m_inode_lock); return m_shared_vmobject.strong_ref(); } |