Changeset 320c884 in mainline for uspace/srv/vfs/vfs.h


Ignore:
Timestamp:
2007-11-04T19:47:32Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
798f364
Parents:
89cb140
Message:

A lot of more VFS prototyping.
VFS_OPEN gets reasonably complete, fix a limitation that prevented file
structures from being shared by multiple file descriptors, add functions for
file descriptor management, introduce unlink_futex and two new VFS operations
VFS_UNLINK and VFS_RENAME.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs.h

    r89cb140 r320c884  
    5757        VFS_WRITE,
    5858        VFS_SEEK,
     59        VFS_RENAME,
     60        VFS_UNLINK,
    5961        VFS_LAST,               /* keep this the last member of the enum */
    6062} vfs_request_t;
     
    131133typedef struct {
    132134        VFS_TRIPLET;            /**< Identity of the node. */
    133         atomic_t refcnt;        /**< Usage counter. */
     135        unsigned refcnt;        /**< Usage counter. */
     136        link_t nh_link;         /**< Node hash-table link. */
    134137} vfs_node_t;
    135138
     
    142145       
    143146        /** Number of file handles referencing this file. */
    144         atomic_t refcnt;
     147        unsigned refcnt;
    145148
    146149        /** Current position in the file. */
     
    167170extern link_t plb_head;         /**< List of active PLB entries. */
    168171
     172extern atomic_t unlink_futex;   /**< VFS_{CREATE|OPEN|UNLINK} serialization. */
     173
    169174extern int vfs_grab_phone(int);
    170175extern void vfs_release_phone(int);
     
    173178
    174179extern int vfs_lookup_internal(char *, size_t, vfs_triplet_t *, vfs_pair_t *);
     180
     181
    175182extern vfs_node_t *vfs_node_get(vfs_triplet_t *);
     183extern void vfs_node_put(vfs_node_t *);
     184
     185extern bool vfs_files_init(void);
     186extern vfs_file_t *vfs_file_get(int);
     187extern int vfs_fd_alloc(void);
     188extern void vfs_fd_free(int);
     189
     190extern void vfs_file_addref(vfs_file_t *);
     191extern void vfs_file_delref(vfs_file_t *);
     192
     193extern void vfs_node_addref(vfs_node_t *);
     194extern void vfs_node_delref(vfs_node_t *);
    176195
    177196#define MAX_OPEN_FILES  128     
Note: See TracChangeset for help on using the changeset viewer.