serenity/Kernel/FileSystem/ProcFS/Inode.cpp
sin-ack 3b03077abb Kernel: Update the ".." inode for directories after a rename
Because the ".." entry in a directory is a separate inode, if a
directory is renamed to a new location, then we should update this entry
the point to the new parent directory as well.

Co-authored-by: Liav A <liavalb@gmail.com>
2022-11-25 17:33:05 +01:00

55 lines
1 KiB
C++

/*
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Spencer Dixon <spencercdixon@gmail.com>
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/FileSystem/ProcFS/Inode.h>
namespace Kernel {
ProcFSInode::ProcFSInode(ProcFS const& fs, InodeIndex index)
: Inode(const_cast<ProcFS&>(fs), index)
{
}
ProcFSInode::~ProcFSInode() = default;
ErrorOr<void> ProcFSInode::flush_metadata()
{
return {};
}
ErrorOr<void> ProcFSInode::add_child(Inode&, StringView, mode_t)
{
return EROFS;
}
ErrorOr<NonnullLockRefPtr<Inode>> ProcFSInode::create_child(StringView, mode_t, dev_t, UserID, GroupID)
{
return EROFS;
}
ErrorOr<void> ProcFSInode::remove_child(StringView)
{
return EROFS;
}
ErrorOr<void> ProcFSInode::chmod(mode_t)
{
return EPERM;
}
ErrorOr<void> ProcFSInode::chown(UserID, GroupID)
{
return EPERM;
}
ErrorOr<void> ProcFSInode::replace_child(StringView, Inode&)
{
return EROFS;
}
}