2018-10-10 11:53:07 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/ByteBuffer.h>
|
|
|
|
#include <AK/Types.h>
|
|
|
|
|
2018-11-15 17:13:10 +01:00
|
|
|
class FS;
|
2018-10-10 11:53:07 +02:00
|
|
|
struct InodeMetadata;
|
|
|
|
|
|
|
|
class InodeIdentifier {
|
|
|
|
public:
|
|
|
|
InodeIdentifier() { }
|
2019-01-31 17:31:23 +01:00
|
|
|
InodeIdentifier(dword fsid, dword inode)
|
|
|
|
: m_fsid(fsid)
|
2018-10-10 11:53:07 +02:00
|
|
|
, m_index(inode)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-12-03 00:20:00 +01:00
|
|
|
bool is_valid() const { return m_fsid != 0 && m_index != 0; }
|
2018-10-10 11:53:07 +02:00
|
|
|
|
2018-12-03 00:20:00 +01:00
|
|
|
dword fsid() const { return m_fsid; }
|
2018-10-10 11:53:07 +02:00
|
|
|
dword index() const { return m_index; }
|
|
|
|
|
2018-12-03 00:20:00 +01:00
|
|
|
FS* fs();
|
|
|
|
const FS* fs() const;
|
2018-10-10 11:53:07 +02:00
|
|
|
|
|
|
|
bool operator==(const InodeIdentifier& other) const
|
|
|
|
{
|
2018-12-03 00:20:00 +01:00
|
|
|
return m_fsid == other.m_fsid && m_index == other.m_index;
|
2018-10-10 11:53:07 +02:00
|
|
|
}
|
|
|
|
|
2018-10-24 14:28:22 +02:00
|
|
|
bool operator!=(const InodeIdentifier& other) const
|
|
|
|
{
|
2018-12-03 00:20:00 +01:00
|
|
|
return m_fsid != other.m_fsid || m_index != other.m_index;
|
2018-10-24 14:28:22 +02:00
|
|
|
}
|
|
|
|
|
2018-12-03 00:20:00 +01:00
|
|
|
bool is_root_inode() const;
|
2018-10-10 11:53:07 +02:00
|
|
|
|
|
|
|
private:
|
2018-12-03 00:20:00 +01:00
|
|
|
dword m_fsid { 0 };
|
2018-10-10 11:53:07 +02:00
|
|
|
dword m_index { 0 };
|
|
|
|
};
|
|
|
|
|