Changeset b6035ba in mainline for uspace/lib/libfs/libfs.h


Ignore:
Timestamp:
2009-05-05T22:09:13Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
770d281
Parents:
c852f4be
Message:

Introduce the concept of FS nodes. A FS node is a typed abstraction of
file-system-specific node type. It replaces the void * in libfs interfaces
and is suitable for holding various information such as mount point data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libfs/libfs.h

    rc852f4be rb6035ba  
    4343
    4444typedef struct {
    45         void * (* match)(void *, const char *);
    46         void * (* node_get)(dev_handle_t, fs_index_t);
    47         void (* node_put)(void *);
    48         void * (* create)(dev_handle_t, int);
    49         int (* destroy)(void *);
    50         int (* link)(void *, void *, const char *);
    51         int (* unlink)(void *, void *);
    52         fs_index_t (* index_get)(void *);
    53         size_t (* size_get)(void *);
    54         unsigned (* lnkcnt_get)(void *);
    55         bool (* has_children)(void *);
    56         void *(* root_get)(dev_handle_t);
     45        void *data;     /**< Data of the file system implementation. */
     46} fs_node_t;
     47
     48typedef struct {
     49        fs_node_t * (* match)(fs_node_t *, const char *);
     50        fs_node_t * (* node_get)(dev_handle_t, fs_index_t);
     51        void (* node_put)(fs_node_t *);
     52        fs_node_t * (* create)(dev_handle_t, int);
     53        int (* destroy)(fs_node_t *);
     54        int (* link)(fs_node_t *, fs_node_t *, const char *);
     55        int (* unlink)(fs_node_t *, fs_node_t *);
     56        fs_index_t (* index_get)(fs_node_t *);
     57        size_t (* size_get)(fs_node_t *);
     58        unsigned (* lnkcnt_get)(fs_node_t *);
     59        bool (* has_children)(fs_node_t *);
     60        fs_node_t *(* root_get)(dev_handle_t);
    5761        char (* plb_get_char)(unsigned pos);   
    58         bool (* is_directory)(void *);
    59         bool (* is_file)(void *);
     62        bool (* is_directory)(fs_node_t *);
     63        bool (* is_file)(fs_node_t *);
    6064} libfs_ops_t;
    6165
Note: See TracChangeset for help on using the changeset viewer.