mirror of
https://github.com/drasko/codezero.git
synced 2026-02-01 20:53:16 +01:00
Removed linux linked list dependency.
This commit is contained in:
@@ -85,10 +85,10 @@ struct dentry {
|
||||
int refcnt;
|
||||
char name[VFS_DNAME_MAX];
|
||||
struct dentry *parent; /* Parent dentry */
|
||||
struct list_head child; /* List of dentries with same parent */
|
||||
struct list_head children; /* List of children dentries */
|
||||
struct list_head vref; /* For vnode's dirent reference list */
|
||||
struct list_head cache_list; /* Dentry cache reference */
|
||||
struct link child; /* List of dentries with same parent */
|
||||
struct link children; /* List of children dentries */
|
||||
struct link vref; /* For vnode's dirent reference list */
|
||||
struct link cache_list; /* Dentry cache reference */
|
||||
struct vnode *vnode; /* The vnode associated with dentry */
|
||||
struct dentry_ops ops;
|
||||
};
|
||||
@@ -120,8 +120,8 @@ struct vnode {
|
||||
struct superblock *sb; /* Reference to superblock */
|
||||
struct vnode_ops ops; /* Operations on this vnode */
|
||||
struct file_ops fops; /* File-related operations on this vnode */
|
||||
struct list_head dentries; /* Dirents that refer to this vnode */
|
||||
struct list_head cache_list; /* For adding the vnode to vnode cache */
|
||||
struct link dentries; /* Dirents that refer to this vnode */
|
||||
struct link cache_list; /* For adding the vnode to vnode cache */
|
||||
struct dirbuf dirbuf; /* Only directory buffers are kept */
|
||||
u32 mode; /* Permissions and vnode type */
|
||||
u32 owner; /* Owner */
|
||||
@@ -149,15 +149,15 @@ struct file_system_type {
|
||||
char name[VFS_FSNAME_MAX];
|
||||
unsigned long magic;
|
||||
struct fstype_ops ops;
|
||||
struct list_head list; /* Member of list of all fs types */
|
||||
struct list_head sblist; /* List of superblocks with this type */
|
||||
struct link list; /* Member of list of all fs types */
|
||||
struct link sblist; /* List of superblocks with this type */
|
||||
};
|
||||
struct superblock *get_superblock(void *buf);
|
||||
|
||||
struct superblock {
|
||||
u64 fssize;
|
||||
unsigned int blocksize;
|
||||
struct list_head list;
|
||||
struct link list;
|
||||
struct file_system_type *fs;
|
||||
struct superblock_ops *ops;
|
||||
struct vnode *root;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
struct global_list {
|
||||
int total;
|
||||
struct list_head list;
|
||||
struct link list;
|
||||
};
|
||||
|
||||
extern struct global_list global_vm_files;
|
||||
|
||||
@@ -66,8 +66,8 @@ struct memfs_superblock {
|
||||
u64 fmaxblocks; /* Maximum number of blocks per file */
|
||||
u64 fssize; /* Total size of filesystem */
|
||||
unsigned long root_vnum; /* The root vnum of this superblock */
|
||||
struct list_head inode_cache_list; /* Chain of alloc caches */
|
||||
struct list_head block_cache_list; /* Chain of alloc caches */
|
||||
struct link inode_cache_list; /* Chain of alloc caches */
|
||||
struct link block_cache_list; /* Chain of alloc caches */
|
||||
struct id_pool *ipool; /* Index pool for inodes */
|
||||
struct id_pool *bpool; /* Index pool for blocks */
|
||||
struct memfs_inode *inode[MEMFS_TOTAL_INODES]; /* Table of inodes */
|
||||
@@ -88,7 +88,7 @@ extern struct file_ops memfs_file_operations;
|
||||
|
||||
int memfs_format_filesystem(void *buffer);
|
||||
struct memfs_inode *memfs_create_inode(struct memfs_superblock *sb);
|
||||
void memfs_register_fstype(struct list_head *);
|
||||
void memfs_register_fstype(struct link *);
|
||||
struct superblock *memfs_get_superblock(void *block);
|
||||
int memfs_generate_superblock(void *block);
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
#define VFS_STR_XATDIR "...."
|
||||
|
||||
struct pathdata {
|
||||
struct list_head list;
|
||||
struct link list;
|
||||
struct vnode *vstart;
|
||||
};
|
||||
|
||||
struct pathcomp {
|
||||
struct list_head list;
|
||||
struct link list;
|
||||
const char *str;
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ struct task_fs_data {
|
||||
/* Thread control block, fs0 portion */
|
||||
struct tcb {
|
||||
l4id_t tid;
|
||||
struct list_head list;
|
||||
struct link list;
|
||||
unsigned long shpage_address;
|
||||
struct task_fd_head *files;
|
||||
struct task_fs_data *fs_data;
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
#include <task.h>
|
||||
#include <path.h>
|
||||
|
||||
extern struct list_head vnode_cache;
|
||||
extern struct list_head dentry_cache;
|
||||
extern struct link vnode_cache;
|
||||
extern struct link dentry_cache;
|
||||
|
||||
/*
|
||||
* This is a temporary replacement for page cache support provided by mm0.
|
||||
* This is a temporary origacement for page cache support provided by mm0.
|
||||
* Normally mm0 tracks all vnode pages, but this is used to track pages in
|
||||
* directory vnodes, which are normally never mapped by tasks.
|
||||
*/
|
||||
@@ -36,10 +36,10 @@ static inline struct dentry *vfs_alloc_dentry(void)
|
||||
{
|
||||
struct dentry *d = kzalloc(sizeof(struct dentry));
|
||||
|
||||
INIT_LIST_HEAD(&d->child);
|
||||
INIT_LIST_HEAD(&d->children);
|
||||
INIT_LIST_HEAD(&d->vref);
|
||||
INIT_LIST_HEAD(&d->cache_list);
|
||||
link_init(&d->child);
|
||||
link_init(&d->children);
|
||||
link_init(&d->vref);
|
||||
link_init(&d->cache_list);
|
||||
|
||||
return d;
|
||||
}
|
||||
@@ -53,8 +53,8 @@ static inline struct vnode *vfs_alloc_vnode(void)
|
||||
{
|
||||
struct vnode *v = kzalloc(sizeof(struct vnode));
|
||||
|
||||
INIT_LIST_HEAD(&v->dentries);
|
||||
INIT_LIST_HEAD(&v->cache_list);
|
||||
link_init(&v->dentries);
|
||||
link_init(&v->cache_list);
|
||||
|
||||
return v;
|
||||
}
|
||||
@@ -62,14 +62,14 @@ static inline struct vnode *vfs_alloc_vnode(void)
|
||||
static inline void vfs_free_vnode(struct vnode *v)
|
||||
{
|
||||
BUG(); /* Are the dentries freed ??? */
|
||||
list_del(&v->cache_list);
|
||||
list_remove(&v->cache_list);
|
||||
kfree(v);
|
||||
}
|
||||
|
||||
static inline struct superblock *vfs_alloc_superblock(void)
|
||||
{
|
||||
struct superblock *sb = kmalloc(sizeof(struct superblock));
|
||||
INIT_LIST_HEAD(&sb->list);
|
||||
link_init(&sb->list);
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user