BarryServer : Git

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

// Related

Nucleus

Barry Super block object f9d8430 (3 years, 3 months ago)
diff --git a/include/nucleus/vfs.h b/include/nucleus/vfs.h
index 8ac8613..df3be93 100644
--- a/include/nucleus/vfs.h
+++ b/include/nucleus/vfs.h
@@ -8,11 +8,28 @@
 
 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 Inode *(*mount_callback_t)(FSType *, int, const char *, void *);
 
+/* Structure for a Super Block */
+struct SuperBlock {
+	Object obj;
+	FSType *type;
+	SuperOps *ops;
+	Inode *root;
+	ObjectList *inodes; /* List of cached inodes */
+	void *data;
+};
+struct SuperOps {
+	Inode *(*alloc_inode)(SuperBlock *);
+	int (*write_inode)(Inode *);
+	void (*delete_inode)(Inode *);
+};
+
 /* Structure for an Inode */
 struct Inode {
 	Object obj;
@@ -24,6 +41,7 @@ struct Inode {
 	size_t size;
 	dev_t dev;
 	InodeOps *ops;
+	SuperBlock *super;
 	union {
 		ObjectList *pages;
 	};