diff options
Diffstat (limited to 'src/sys/include/os')
-rw-r--r-- | src/sys/include/os/kalloc.h | 8 | ||||
-rw-r--r-- | src/sys/include/os/vnode.h | 24 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/sys/include/os/kalloc.h b/src/sys/include/os/kalloc.h index 143c4f9..aaaaa74 100644 --- a/src/sys/include/os/kalloc.h +++ b/src/sys/include/os/kalloc.h @@ -48,6 +48,14 @@ void *kalloc(size_t sz); /* + * Reallocates memory pool created by `dynalloc()' + * + * @old_ptr: Pointer to old pool. + * @newsize: Size of new pool. + */ +void *krealloc(void *old_ptr, size_t newsize); + +/* * Free a chunk of memory given to by * `ptr' * diff --git a/src/sys/include/os/vnode.h b/src/sys/include/os/vnode.h index 1bef1e2..628ba68 100644 --- a/src/sys/include/os/vnode.h +++ b/src/sys/include/os/vnode.h @@ -32,6 +32,7 @@ #include <sys/types.h> #include <sys/atomic.h> +#include <sys/namei.h> /* Forward declarations */ struct vnode; @@ -83,12 +84,23 @@ struct vop_rw_data { }; /* + * Arguments to create an entry within a + * filesystem + * + * @ndp: Path component to create + */ +struct vop_create_args { + struct nameidata *ndp; +}; + +/* * Represents operations that can be performed on * a specific vnode. These are implemented as callbacks */ struct vop { int(*lookup)(struct vop_lookup_args *args); int(*reclaim)(struct vnode *vp, int flags); + int(*create)(struct vop_create_args *args); ssize_t(*write)(struct vop_rw_data *data); ssize_t(*read)(struct vop_rw_data *data); }; @@ -176,4 +188,16 @@ ssize_t vop_read(struct vnode *vp, char *data, off_t off, size_t len); */ int vop_reclaim(struct vnode *vp, int flags); +/* + * Create a node within a specific filesystem or + * directory + * + * @vp: Vnode of parent directory + * @ndp: Namei descriptor of path component + * + * Returns zero on success, otherwise a less than zero + * value on failure. + */ +int vop_create(struct vnode *vp, struct nameidata *ndp); + #endif /* !_OS_VNODE_H_ */ |