diff options
Diffstat (limited to 'src/kernel/include')
-rw-r--r-- | src/kernel/include/nullfs.h | 10 | ||||
-rw-r--r-- | src/kernel/include/vfs.h | 11 |
2 files changed, 9 insertions, 12 deletions
diff --git a/src/kernel/include/nullfs.h b/src/kernel/include/nullfs.h index ba6a9c8..6ab8760 100644 --- a/src/kernel/include/nullfs.h +++ b/src/kernel/include/nullfs.h @@ -7,13 +7,11 @@ // - d : allow deletion of arbitrary nodes // - m : allow move operation -typedef struct nullfs nullfs_t; - void register_nullfs_driver(); -nullfs_t* as_nullfs(fs_t *fs); - -bool nullfs_add_node(nullfs_t *f, const char* name, fs_node_ptr data, fs_node_ops_t *ops); -bool nullfs_add_ram_file(nullfs_t *f, const char* name, char* data, size_t init_sz, bool copy, int ok_modes); +// These calls can be done on the fs_t corresponding to a nullfs +// Of course they fail if the fs is not actually a nullfs. +bool nullfs_add_node(fs_t *f, const char* name, fs_node_ptr data, fs_node_ops_t *ops); +bool nullfs_add_ram_file(fs_t *f, const char* name, char* data, size_t init_sz, bool copy, int ok_modes); /* vim: set ts=4 sw=4 tw=0 noet :*/ diff --git a/src/kernel/include/vfs.h b/src/kernel/include/vfs.h index b0fd146..2a5f3d8 100644 --- a/src/kernel/include/vfs.h +++ b/src/kernel/include/vfs.h @@ -30,7 +30,6 @@ struct fs_handle; typedef struct { size_t (*read)(fs_handle_ptr f, size_t offset, size_t len, char* buf); size_t (*write)(fs_handle_ptr f, size_t offset, size_t len, const char* buf); - bool (*stat)(fs_handle_ptr f, stat_t *st); bool (*readdir)(fs_handle_ptr f, dirent_t *d); void (*close)(fs_handle_ptr f); } fs_handle_ops_t; @@ -38,7 +37,7 @@ typedef struct { typedef struct fs_handle { // These two field are filled by the VFS's generic open() code struct fs *fs; - struct fs_node *n; + struct fs_node *node; int refs; // These fields are filled by the FS's specific open() code @@ -54,7 +53,7 @@ typedef struct fs_handle { // Remarks : // - fs_node_t not to be used in public interface // - nodes keep a reference to their parent -// - delete() is expected to delete the node (make it inaccessible), but not dispose +// - unink() is expected to unink the node from its parent (make it inaccessible), but not dispose // of its data before dispos() is called !! // - the root node of a filesystem is created when the filesystem is created // - dispose() is not called on the root node when a filesystem is shutdown @@ -63,8 +62,8 @@ typedef struct { bool (*open)(fs_node_ptr n, int mode, fs_handle_t *s); // open current node bool (*stat)(fs_node_ptr n, stat_t *st); bool (*walk)(fs_node_ptr n, const char* file, struct fs_node *node_d); - bool (*delete)(fs_node_ptr n); - bool (*move)(fs_node_ptr n, struct fs_node *new_parent, const char *new_name); // TODO : not sure about this ? + bool (*unlink)(fs_node_ptr n, const char* file); + bool (*move)(fs_node_ptr dir, const char* old_name, struct fs_node *new_parent, const char *new_name); bool (*create)(fs_node_ptr n, const char* name, int type); // create sub-node in directory int (*ioctl)(fs_node_ptr n, int command, void* data); void (*dispose)(fs_node_ptr n); @@ -131,7 +130,7 @@ void ref_fs(fs_t *fs); void unref_fs(fs_t *fs); bool fs_create(fs_t *fs, const char* file, int type); -bool fs_delete(fs_t *fs, const char* file); +bool fs_unlink(fs_t *fs, const char* file); bool fs_move(fs_t *fs, const char* from, const char* to); bool fs_stat(fs_t *fs, const char* file, stat_t *st); int fs_ioctl(fs_t *fs, const char* file, int command, void* data); |