Skip to content

Commit

Permalink
Kernel: Rename VFS => VirtualFileSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Jul 10, 2021
1 parent d53d9d3 commit 0d39bd0
Show file tree
Hide file tree
Showing 38 changed files with 124 additions and 124 deletions.
4 changes: 2 additions & 2 deletions Kernel/CoreDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CoreDump::CoreDump(NonnullRefPtr<Process> process, NonnullRefPtr<FileDescription
RefPtr<FileDescription> CoreDump::create_target_file(const Process& process, const String& output_path)
{
auto output_directory = KLexicalPath::dirname(output_path);
auto dump_directory = VFS::the().open_directory(output_directory, VFS::the().root_custody());
auto dump_directory = VirtualFileSystem::the().open_directory(output_directory, VirtualFileSystem::the().root_custody());
if (dump_directory.is_error()) {
dbgln("Can't find directory '{}' for core dump", output_directory);
return nullptr;
Expand All @@ -56,7 +56,7 @@ RefPtr<FileDescription> CoreDump::create_target_file(const Process& process, con
dbgln("Refusing to put core dump in sketchy directory '{}'", output_directory);
return nullptr;
}
auto fd_or_error = VFS::the().open(
auto fd_or_error = VirtualFileSystem::the().open(
KLexicalPath::basename(output_path),
O_CREAT | O_WRONLY | O_EXCL,
S_IFREG, // We will enable reading from userspace when we finish generating the coredump file
Expand Down
2 changes: 1 addition & 1 deletion Kernel/FileSystem/FileDescription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ KResultOr<size_t> FileDescription::get_dir_entries(UserOrKernelBuffer& output_bu
return true;
};

KResult result = VFS::the().traverse_directory_inode(*m_inode, [&flush_stream_to_output_buffer, &stream, this](auto& entry) {
KResult result = VirtualFileSystem::the().traverse_directory_inode(*m_inode, [&flush_stream_to_output_buffer, &stream, this](auto& entry) {
size_t serialized_size = sizeof(ino_t) + sizeof(u8) + sizeof(size_t) + sizeof(char) * entry.name.length();
if (serialized_size > stream.remaining()) {
if (!flush_stream_to_output_buffer()) {
Expand Down
4 changes: 2 additions & 2 deletions Kernel/FileSystem/FileDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class FileDescription : public RefCounted<FileDescription> {

OwnPtr<FileDescriptionData>& data() { return m_data; }

void set_original_inode(Badge<VFS>, NonnullRefPtr<Inode>&& inode) { m_inode = move(inode); }
void set_original_inode(Badge<VirtualFileSystem>, NonnullRefPtr<Inode>&& inode) { m_inode = move(inode); }

KResult truncate(u64);

Expand All @@ -124,7 +124,7 @@ class FileDescription : public RefCounted<FileDescription> {
FileBlockCondition& block_condition();

private:
friend class VFS;
friend class VirtualFileSystem;
explicit FileDescription(File&);

KResult attach();
Expand Down
4 changes: 2 additions & 2 deletions Kernel/FileSystem/Inode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ KResultOr<NonnullRefPtr<Custody>> Inode::resolve_as_link(Custody& base, RefPtr<C

auto& contents = contents_or.value();
auto path = StringView(contents->data(), contents->size());
return VFS::the().resolve_path(path, base, out_parent, options, symlink_recursion_level);
return VirtualFileSystem::the().resolve_path(path, base, out_parent, options, symlink_recursion_level);
}

Inode::Inode(FileSystem& fs, InodeIndex index)
Expand Down Expand Up @@ -254,7 +254,7 @@ void Inode::did_delete_self()
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 VFS layer so this can happen from a single place.
// We should funnel everything through an interface at the VirtualFileSystem layer so this can happen from a single place.
Locker locker(m_lock);
if (fs().is_readonly())
return EROFS;
Expand Down
2 changes: 1 addition & 1 deletion Kernel/FileSystem/Inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Kernel {

class Inode : public RefCounted<Inode>
, public Weakable<Inode> {
friend class VFS;
friend class VirtualFileSystem;
friend class FileSystem;

public:
Expand Down
4 changes: 2 additions & 2 deletions Kernel/FileSystem/InodeFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ KResult InodeFile::chown(FileDescription& description, uid_t uid, gid_t gid)
{
VERIFY(description.inode() == m_inode);
VERIFY(description.custody());
return VFS::the().chown(*description.custody(), uid, gid);
return VirtualFileSystem::the().chown(*description.custody(), uid, gid);
}

KResult InodeFile::chmod(FileDescription& description, mode_t mode)
{
VERIFY(description.inode() == m_inode);
VERIFY(description.custody());
return VFS::the().chmod(*description.custody(), mode);
return VirtualFileSystem::the().chmod(*description.custody(), mode);
}

}
Loading

0 comments on commit 0d39bd0

Please sign in to comment.