summaryrefslogtreecommitdiff
path: root/Source/Kernel/VFS/FSNode.proto.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/VFS/FSNode.proto.h')
-rw-r--r--Source/Kernel/VFS/FSNode.proto.h37
1 files changed, 10 insertions, 27 deletions
diff --git a/Source/Kernel/VFS/FSNode.proto.h b/Source/Kernel/VFS/FSNode.proto.h
index 62d28be..fb24a82 100644
--- a/Source/Kernel/VFS/FSNode.proto.h
+++ b/Source/Kernel/VFS/FSNode.proto.h
@@ -3,8 +3,8 @@
#include <Core/common.wtf.h>
#include <Library/String.class.h>
-
-class FileSystem;
+class FSNode;
+#include <VFS/FileSystem.proto.h>
enum {
NT_FILE = 1,
@@ -20,12 +20,11 @@ class FSNode {
u32int m_permissions, m_uid, m_gid;
FileSystem *m_fs;
FSNode *m_parent;
- u32int m_inode;
- FSNode(String name, FileSystem* fs, FSNode* parent, u32int inode, u32int length = 0, u32int permissions = 0777,
+ FSNode(String name, FileSystem* fs, FSNode* parent, u32int length = 0, u32int permissions = 0777,
u32int uid = 0, u32int gid = 0) :
- m_name(name), m_fs(fs), m_parent(parent), m_inode(inode), m_length(length), m_premissions(permissions),
- m_uid(uid), m_gid(gid) {}
+ m_name(name), m_length(length), m_permissions(permissions),
+ m_uid(uid), m_gid(gid), m_fs(fs), m_parent(parent) {}
public:
@@ -38,49 +37,33 @@ class FSNode {
u32int getGid() { return m_gid; }
FileSystem *getFS() { return m_fs; }
FSNode* getParent() { return m_parent; }
- u32int getInode() { return m_inode; }
-
- protected:
- //Must be implemented by *FSNode
- virtual bool FSSetName(String name) = 0;
- virtual bool FSTruncate() = 0;
- virtual bool FSSetPermissions(u32int permissions) = 0;
- virtual bool FSSetUid(u32int uid) = 0;
- virtual bool FSSetGid(u32int gid) = 0;
- virtual bool FSSetParent(FSNode* parent) = 0;
public:
bool setName(String name) {
- bool b = FSSetName(name);
+ bool b = m_fs->setName(this, name);
if (b) m_name = name;
return b;
}
- bool truncate() {
- bool b = FSTruncate();
- if (b) m_length = 0;
- return b;
- }
bool setPermissions(u32int permissions) {
- bool b = FSSetPermissions(permissions);
+ bool b = m_fs->setPermissions(this, permissions);
if (b) m_permissions = permissions;
return b;
}
bool setUid(u32int uid) {
- bool b = FSSetUid(uid);
+ bool b = m_fs->setUid(this, uid);
if (b) m_uid = uid;
return b;
}
bool setGid(u32int gid) {
- bool b = FSSetGid(gid);
+ bool b = m_fs->setGid(this, gid);
if (b) m_gid = gid;
return b;
}
bool setParent(FSNode* parent) {
- bool b = FSSetParent(parent); //FSSetParent is only expected to move files/directories in the same filesystem
+ bool b = m_fs->setParent(this, parent); //FSSetParent is only expected to move files/directories in the same filesystem
if (b) m_parent = parent;
return b;
}
- void setInode(u32int inode) { m_inode = inode; }
};
#endif