mirror of
https://github.com/drasko/codezero.git
synced 2026-03-28 23:09:03 +01:00
Added new path parsing functions that work cleaner, better.
Input paths are now parsed at the beginning and components put into an ordered linked list headed by struct pathdata. Lookup functions use these components to look up vnodes.
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#ifndef __PATH_H__
|
||||
#define __PATH_H__
|
||||
|
||||
#include <l4/lib/list.h>
|
||||
|
||||
/*
|
||||
* FIXME:
|
||||
* These ought to be strings and split/comparison functions should
|
||||
@@ -18,9 +20,22 @@
|
||||
#define VFS_STR_XATDIR "...."
|
||||
|
||||
struct pathdata {
|
||||
struct list_head list;
|
||||
struct tcb *task;
|
||||
int root;
|
||||
char *path;
|
||||
};
|
||||
|
||||
struct pathcomp {
|
||||
struct list_head list;
|
||||
char *str;
|
||||
};
|
||||
|
||||
struct pathdata *pathdata_parse(const char *pathname, char *pathbuf,
|
||||
struct tcb *task);
|
||||
void pathdata_destroy(struct pathdata *p);
|
||||
|
||||
/* Destructive, i.e. unlinks those components from list */
|
||||
char *pathdata_next_component(struct pathdata *pdata);
|
||||
char *pathdata_last_component(struct pathdata *pdata);
|
||||
|
||||
#endif /* __PATH_H__ */
|
||||
|
||||
@@ -83,7 +83,7 @@ extern struct vfs_mountpoint vfs_root;
|
||||
|
||||
int vfs_mount_root(struct superblock *sb);
|
||||
struct vnode *generic_vnode_lookup(struct vnode *thisnode, struct pathdata *p);
|
||||
struct vnode *vfs_lookup_bypath(struct tcb *task, struct pathdata *p);
|
||||
struct vnode *vfs_lookup_bypath(struct pathdata *p);
|
||||
struct vnode *vfs_lookup_byvnum(struct superblock *sb, unsigned long vnum);
|
||||
|
||||
#endif /* __VFS_H__ */
|
||||
|
||||
Reference in New Issue
Block a user