mirror of
https://github.com/drasko/codezero.git
synced 2026-02-13 18:33:15 +01:00
Added resolving of current directory in case lookup starts from current dir.
This commit is contained in:
@@ -22,7 +22,7 @@ struct superblock;
|
||||
struct vnode;
|
||||
|
||||
struct dentry_ops {
|
||||
int (*compare)(struct dentry *d, char *n);
|
||||
int (*compare)(struct dentry *d, const char *n);
|
||||
};
|
||||
|
||||
/* Operations that work on file content */
|
||||
@@ -47,13 +47,13 @@ struct file_ops {
|
||||
struct vnode_ops {
|
||||
vnode_op_t create;
|
||||
struct vnode *(*lookup)(struct vnode *root, struct pathdata *pdata,
|
||||
char *component);
|
||||
const char *component);
|
||||
int (*readdir)(struct vnode *v);
|
||||
int (*filldir)(void *buf, struct vnode *v, int count);
|
||||
vnode_op_t link;
|
||||
vnode_op_t unlink;
|
||||
int (*mkdir)(struct vnode *parent, char *name);
|
||||
int (*mknod)(struct vnode *parent, char *name, unsigned int mode);
|
||||
int (*mkdir)(struct vnode *parent, const char *name);
|
||||
int (*mknod)(struct vnode *parent, const char *name, unsigned int mode);
|
||||
vnode_op_t rmdir;
|
||||
vnode_op_t rename;
|
||||
vnode_op_t getattr;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#define __PATH_H__
|
||||
|
||||
#include <l4/lib/list.h>
|
||||
#include <task.h>
|
||||
|
||||
/*
|
||||
* FIXME:
|
||||
@@ -21,13 +22,13 @@
|
||||
|
||||
struct pathdata {
|
||||
struct list_head list;
|
||||
struct tcb *task;
|
||||
struct vnode *vstart;
|
||||
int root;
|
||||
};
|
||||
|
||||
struct pathcomp {
|
||||
struct list_head list;
|
||||
char *str;
|
||||
const char *str;
|
||||
};
|
||||
|
||||
struct pathdata *pathdata_parse(const char *pathname, char *pathbuf,
|
||||
@@ -35,7 +36,7 @@ struct pathdata *pathdata_parse(const char *pathname, char *pathbuf,
|
||||
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);
|
||||
const char *pathdata_next_component(struct pathdata *pdata);
|
||||
const 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,
|
||||
char *component);
|
||||
const char *component);
|
||||
struct vnode *vfs_lookup_bypath(struct pathdata *p);
|
||||
struct vnode *vfs_lookup_byvnum(struct superblock *sb, unsigned long vnum);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user