summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-23 05:38:54 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-23 05:39:11 +0100
commit730c14e647edc1d0bf3a420d8ac9290615b4901e (patch)
tree6f4985691d584e035deb0a0b126aa14e04a44053
parenta1b4f719bab1603294c21215419b6ecb1621b7f7 (diff)
downloadserenity-730c14e647edc1d0bf3a420d8ac9290615b4901e.zip
VFS: Rename FS::id() to fsid() for consistency.
-rw-r--r--Kernel/Ext2FileSystem.cpp14
-rw-r--r--Kernel/FileSystem.h6
-rw-r--r--Kernel/SyntheticFileSystem.cpp8
3 files changed, 14 insertions, 14 deletions
diff --git a/Kernel/Ext2FileSystem.cpp b/Kernel/Ext2FileSystem.cpp
index bd46f56de0..505fdcc794 100644
--- a/Kernel/Ext2FileSystem.cpp
+++ b/Kernel/Ext2FileSystem.cpp
@@ -129,7 +129,7 @@ const char* Ext2FS::class_name() const
InodeIdentifier Ext2FS::root_inode() const
{
- return { id(), EXT2_ROOT_INO };
+ return { fsid(), EXT2_ROOT_INO };
}
ByteBuffer Ext2FS::read_block_containing_inode(unsigned inode, unsigned& blockIndex, unsigned& offset) const
@@ -363,7 +363,7 @@ void Ext2FSInode::flush_metadata()
RetainPtr<Inode> Ext2FS::get_inode(InodeIdentifier inode) const
{
- ASSERT(inode.fsid() == id());
+ ASSERT(inode.fsid() == fsid());
{
LOCKER(m_inode_cache_lock);
auto it = m_inode_cache.find(inode.index());
@@ -709,7 +709,7 @@ bool Ext2FS::write_directory_inode(unsigned directoryInode, Vector<DirectoryEntr
kprintf("\n");
#endif
- return get_inode({ id(), directoryInode })->write_bytes(0, directoryData.size(), directoryData.pointer(), nullptr);
+ return get_inode({ fsid(), directoryInode })->write_bytes(0, directoryData.size(), directoryData.pointer(), nullptr);
}
unsigned Ext2FS::inodes_per_block() const
@@ -1008,7 +1008,7 @@ bool Ext2FS::set_block_allocation_state(GroupIndex group, BlockIndex bi, bool ne
RetainPtr<Inode> Ext2FS::create_directory(InodeIdentifier parent_id, const String& name, Unix::mode_t mode, int& error)
{
- ASSERT(parent_id.fsid() == id());
+ ASSERT(parent_id.fsid() == fsid());
// Fix up the mode to definitely be a directory.
// FIXME: This is a bit on the hackish side.
@@ -1049,7 +1049,7 @@ RetainPtr<Inode> Ext2FS::create_directory(InodeIdentifier parent_id, const Strin
RetainPtr<Inode> Ext2FS::create_inode(InodeIdentifier parent_id, const String& name, Unix::mode_t mode, unsigned size, int& error)
{
- ASSERT(parent_id.fsid() == id());
+ ASSERT(parent_id.fsid() == fsid());
auto parent_inode = get_inode(parent_id);
dbgprintf("Ext2FS: Adding inode '%s' (mode %u) to parent directory %u:\n", name.characters(), mode, parent_inode->identifier().index());
@@ -1087,7 +1087,7 @@ RetainPtr<Inode> Ext2FS::create_inode(InodeIdentifier parent_id, const String& n
fileType = EXT2_FT_SYMLINK;
// Try adding it to the directory first, in case the name is already in use.
- bool success = parent_inode->add_child({ id(), inode_id }, name, fileType, error);
+ bool success = parent_inode->add_child({ fsid(), inode_id }, name, fileType, error);
if (!success)
return { };
@@ -1136,7 +1136,7 @@ RetainPtr<Inode> Ext2FS::create_inode(InodeIdentifier parent_id, const String& n
LOCKER(m_inode_cache_lock);
m_inode_cache.remove(inode_id);
}
- return get_inode({ id(), inode_id });
+ return get_inode({ fsid(), inode_id });
}
RetainPtr<Inode> Ext2FSInode::parent() const
diff --git a/Kernel/FileSystem.h b/Kernel/FileSystem.h
index 21a64decbb..789117d252 100644
--- a/Kernel/FileSystem.h
+++ b/Kernel/FileSystem.h
@@ -25,7 +25,7 @@ public:
static void initialize_globals();
virtual ~FS();
- dword id() const { return m_fsid; }
+ unsigned fsid() const { return m_fsid; }
static FS* from_fsid(dword);
static void sync();
@@ -53,7 +53,7 @@ protected:
FS();
private:
- dword m_fsid { 0 };
+ unsigned m_fsid { 0 };
bool m_readonly { false };
};
@@ -132,7 +132,7 @@ inline bool InodeIdentifier::is_root_inode() const
inline unsigned Inode::fsid() const
{
- return m_fs.id();
+ return m_fs.fsid();
}
namespace AK {
diff --git a/Kernel/SyntheticFileSystem.cpp b/Kernel/SyntheticFileSystem.cpp
index 18192467e5..c87bf0c8d7 100644
--- a/Kernel/SyntheticFileSystem.cpp
+++ b/Kernel/SyntheticFileSystem.cpp
@@ -28,7 +28,7 @@ bool SynthFS::initialize()
// Add a File for the root directory.
// FIXME: This needs work.
auto root = adopt(*new SynthFSInode(*this, RootInodeIndex));
- root->m_parent = { id(), RootInodeIndex };
+ root->m_parent = { fsid(), RootInodeIndex };
root->m_metadata.mode = 0040555;
root->m_metadata.uid = 0;
root->m_metadata.gid = 0;
@@ -104,7 +104,7 @@ InodeIdentifier SynthFS::add_file(RetainPtr<SynthFSInode>&& file, InodeIndex par
ASSERT(it != m_inodes.end());
auto new_inode_id = file->identifier();
file->m_metadata.inode = new_inode_id;
- file->m_parent = { id(), parent };
+ file->m_parent = { fsid(), parent };
(*it).value->m_children.append(file.ptr());
m_inodes.set(new_inode_id.index(), move(file));
return new_inode_id;
@@ -147,7 +147,7 @@ const char* SynthFS::class_name() const
InodeIdentifier SynthFS::root_inode() const
{
- return { id(), 1 };
+ return { fsid(), 1 };
}
RetainPtr<Inode> SynthFS::create_inode(InodeIdentifier parentInode, const String& name, Unix::mode_t mode, unsigned size, int& error)
@@ -188,7 +188,7 @@ RetainPtr<Inode> SynthFS::get_inode(InodeIdentifier inode) const
SynthFSInode::SynthFSInode(SynthFS& fs, unsigned index)
: Inode(fs, index)
{
- m_metadata.inode = { fs.id(), index };
+ m_metadata.inode = { fs.fsid(), index };
}
SynthFSInode::~SynthFSInode()