BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / e19098763d1a308a72840187f844860c05cbfc60 / include / nucleus / vfs.h

// Related

Nucleus

Barry Directory entry object e190987 (3 years, 3 months ago)
diff --git a/include/nucleus/vfs.h b/include/nucleus/vfs.h
index df3be93..fd78c10 100644
--- a/include/nucleus/vfs.h
+++ b/include/nucleus/vfs.h
@@ -6,12 +6,15 @@
 #include <nucleus/object.h>
 #include <nucleus/memory.h>
 
+#define NAME_MAX 255
+
 typedef struct FSType FSType;
 typedef struct FileSystem FileSystem;
 typedef struct SuperBlock SuperBlock;
 typedef struct SuperOps SuperOps;
 typedef struct Inode Inode;
 typedef struct InodeOps InodeOps;
+typedef struct DirEntry DirEntry;
 
 typedef Inode *(*mount_callback_t)(FSType *, int, const char *, void *);
 
@@ -43,19 +46,31 @@ struct Inode {
 	InodeOps *ops;
 	SuperBlock *super;
 	union {
+		ObjectList *dirEntries;
 		ObjectList *pages;
 	};
 };
 struct InodeOps {
 };
 
+/* Structure for a Directory Entry */
+struct DirEntry {
+	Object obj;
+	Inode *inode, *mnt;
+	uint32_t hash;
+	char name[NAME_MAX];
+	SuperBlock *super;
+};
+
 extern ObjectType fstypeType;
 extern ObjectType fsType;
 extern ObjectType inodeType;
+extern ObjectType dirEntryType;
 
 void init_vfs(void);
 void register_fstype(const char *name,	mount_callback_t mount);
 int mount(const char *src, const char *target, const char *type,
           unsigned long flags, void *data);
+DirEntry *find_direntry(ObjectList *list, const char *name);
 
 #endif