Changes between Initial Version and Version 3 of Ticket #2


Ignore:
Timestamp:
Nov 15, 2009, 3:32:57 PM (16 years ago)
Author:
Nicolas Pouillon
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2

    • Property Owner changed from becoulet to Nicolas Pouillon
    • Property Status changed from new to assigned
    • Property Type changed from defect to task
    • Property Summary changed from Implement a correctly-abstracted VFAT driver to Rework VFS
  • Ticket #2 – Description

    initial v3  
    1 See [wiki:ToDo/VirtualFileSystem]
     1= VFS types =
     2
     3struct vfs_mount_state_s
     4{
     5        vfs_fs_open_t *open;
     6        vfs_fs_lookup_t *lookup;
     7        vfs_fs_create_t *create;
     8        vfs_fs_link_t *link;
     9        vfs_fs_unlink_t *unlink;
     10        vfs_fs_stat_t *stat;
     11
     12        struct vfs_node_dir_s *old_node;
     13        struct vfs_node_dir_s *root;
     14};
     15
     16/* base object, inherited twice */
     17struct vfs_node_base_s
     18{
     19        CONTAINER_ENTRY_TYPE(HASHLIST) hash_entry;
     20        enum vfs_node_type_e type;
     21        struct vfs_mount_state_s *mount;
     22        char name[CONFIG_VFS_NAMELEN];
     23        struct vfs_node_dir_s *parent;
     24};
     25
     26struct vfs_node_dir_s
     27{
     28        struct vfs_node_base_s base;
     29        vfs_node_dir_entry_t obj_entry;
     30        vfs_dir_hash_root_t children;
     31};
     32
     33struct vfs_node_leaf_s
     34{
     35        struct vfs_node_base_s base;
     36        vfs_node_leaf_entry_t obj_entry;
     37};
     38
     39/* opened file, it defines the operations */
     40struct vfs_file_s
     41{
     42        struct vfs_node_s *node;
     43        vfs_file_close_t *close;
     44        vfs_file_read_t *read;
     45        vfs_file_write_t *write;
     46        vfs_file_seek_t *seek;
     47};
     48
     49
     50= VFS operations =
     51
     52error_t vfs_mount(struct vfs_node_dir_s *mountpoint,
     53                                  struct vfs_node_dir_s *fs_root);
     54
     55error_t vfs_umount(struct vfs_node_dir_s *fs_root);
     56
     57error_t vfs_node_lookup(struct vfs_node_dir_s *parent,
     58                                                const char *name,
     59                                                size_t namelen,
     60                                                struct vfs_node_base_s **node);
     61
     62error_t vfs_node_create(struct vfs_mount_state_s *fs,
     63                                                enum vfs_node_type_e type,
     64                                                struct vfs_node_base_s **node);
     65
     66error_t vfs_node_link(struct vfs_node_dir_s *parent,
     67                                          struct vfs_node_base_s *node,
     68                                          const char *name,
     69                                          size_t namelen);
     70
     71error_t vfs_node_unlink(struct vfs_node_dir_s *parent,
     72                                                const char *name,
     73                                                size_t namelen);
     74
     75error_t vfs_node_stat(struct vfs_node_base_s *node,
     76                                          struct vfs_stat_s *stat);
     77
     78error_t vfs_file_open(struct vfs_node_leaf_s *ref,
     79                                          struct vfs_file_s **file);