Changeset cf95bc0 in mainline for uspace/srv/fs/tmpfs/tmpfs.h


Ignore:
Timestamp:
2009-05-09T21:56:50Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d4a172b
Parents:
4f46695e
Message:

Streamline TMPFS and fix its design so that it properly supports hardlinks.
libfs operation unlink() is now passed also the name of the component being
unlinked.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs.h

    r4f46695e rcf95bc0  
    4545#endif
    4646
    47 #define TMPFS_NODE(node)        ((node) ? (tmpfs_dentry_t *)(node)->data : NULL)
     47#define TMPFS_NODE(node)        ((node) ? (tmpfs_node_t *)(node)->data : NULL)
    4848#define FS_NODE(node)           ((node) ? (node)->bp : NULL)
    4949
     
    5454} tmpfs_dentry_type_t;
    5555
     56/* forward declaration */
     57struct tmpfs_node;
     58
    5659typedef struct tmpfs_dentry {
     60        link_t link;            /**< Linkage for the list of siblings. */
     61        struct tmpfs_node *node;/**< Back pointer to TMPFS node. */
     62        char *name;             /**< Name of dentry. */
     63} tmpfs_dentry_t;
     64
     65typedef struct tmpfs_node {
    5766        fs_node_t *bp;          /**< Back pointer to the FS node. */
    5867        fs_index_t index;       /**< TMPFS node index. */
    5968        dev_handle_t dev_handle;/**< Device handle. */
    60         link_t dh_link;         /**< Dentries hash table link. */
    61         struct tmpfs_dentry *sibling;
    62         struct tmpfs_dentry *child;
    63         hash_table_t names;     /**< All names linking to this TMPFS node. */
     69        link_t nh_link;         /**< Nodes hash table link. */
    6470        tmpfs_dentry_type_t type;
    6571        unsigned lnkcnt;        /**< Link count. */
    6672        size_t size;            /**< File size if type is TMPFS_FILE. */
    6773        void *data;             /**< File content's if type is TMPFS_FILE. */
    68 } tmpfs_dentry_t;
     74        link_t cs_head;         /**< Head of child's siblings list. */
     75} tmpfs_node_t;
    6976
    7077extern fs_reg_t tmpfs_reg;
Note: See TracChangeset for help on using the changeset viewer.