VFS: Rename FS::id() to fsid() for consistency.

This commit is contained in:
Andreas Kling 2019-01-23 05:38:54 +01:00
parent a1b4f719ba
commit 730c14e647
3 changed files with 14 additions and 14 deletions

View file

@ -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

View file

@ -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 {

View file

@ -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()