Changes in uspace/srv/vfs/vfs.h [c1f7a315:51774cd] in mainline


Ignore:
File:
1 edited

Legend:

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

    rc1f7a315 r51774cd  
    9494        vfs_node_type_t type;
    9595        aoff64_t size;
    96         unsigned int lnkcnt;
    9796} vfs_lookup_res_t;
    9897
     
    101100 * which may be associated with it.
    102101 */
    103 typedef struct {
     102typedef struct _vfs_node {
    104103        VFS_TRIPLET;            /**< Identity of the node. */
    105104
     
    110109        unsigned refcnt;
    111110       
    112         /** Number of names this node has in the file system namespace. */
    113         unsigned lnkcnt;
    114 
    115111        ht_link_t nh_link;              /**< Node hash-table link. */
    116112
     
    123119         */
    124120        fibril_rwlock_t contents_rwlock;
     121       
     122        struct _vfs_node *mount;
    125123} vfs_node_t;
    126124
     
    131129typedef struct {
    132130        /** Serializes access to this open file. */
    133         fibril_mutex_t lock;
     131        fibril_mutex_t _lock;
    134132
    135133        vfs_node_t *node;
     
    138136        unsigned refcnt;
    139137
     138        int permissions;
     139        bool open_read;
     140        bool open_write;
     141
    140142        /** Append on write. */
    141143        bool append;
    142 
    143         /** Current absolute position in the file. */
    144         aoff64_t pos;
    145144} vfs_file_t;
    146145
     
    173172extern void vfs_exchange_release(async_exch_t *);
    174173
    175 extern fs_handle_t fs_name_to_handle(unsigned int instance, char *, bool);
     174extern fs_handle_t fs_name_to_handle(unsigned int instance, const char *, bool);
    176175extern vfs_info_t *fs_handle_to_info(fs_handle_t);
    177176
    178 extern int vfs_lookup_internal(char *, int, vfs_lookup_res_t *,
    179     vfs_pair_t *, ...);
     177extern int vfs_lookup_internal(vfs_node_t *, char *, int, vfs_lookup_res_t *);
     178extern int vfs_link_internal(vfs_node_t *, char *, vfs_triplet_t *);
    180179
    181180extern bool vfs_nodes_init(void);
    182181extern vfs_node_t *vfs_node_get(vfs_lookup_res_t *);
     182extern vfs_node_t *vfs_node_peek(vfs_lookup_res_t *result);
    183183extern void vfs_node_put(vfs_node_t *);
    184184extern void vfs_node_forget(vfs_node_t *);
    185185extern unsigned vfs_nodes_refcount_sum_get(fs_handle_t, service_id_t);
    186186
    187 
    188 #define MAX_OPEN_FILES  128
     187extern bool vfs_node_has_children(vfs_node_t *node);
    189188
    190189extern void *vfs_client_data_create(void);
    191190extern void vfs_client_data_destroy(void *);
    192191
    193 extern void vfs_pass_handle(task_id_t, task_id_t, int);
    194 extern int vfs_wait_handle_internal(void);
     192extern void vfs_op_pass_handle(task_id_t, task_id_t, int);
     193extern int vfs_wait_handle_internal(bool);
    195194
    196195extern vfs_file_t *vfs_file_get(int);
    197196extern void vfs_file_put(vfs_file_t *);
    198197extern int vfs_fd_assign(vfs_file_t *, int);
    199 extern int vfs_fd_alloc(bool desc);
     198extern int vfs_fd_alloc(vfs_file_t **file, bool desc);
    200199extern int vfs_fd_free(int);
    201200
     
    204203extern int vfs_open_node_remote(vfs_node_t *);
    205204
     205extern int vfs_op_clone(int oldfd, int newfd, bool desc);
     206extern int vfs_op_mount(int mpfd, unsigned servid, unsigned flags, unsigned instance, const char *opts, const char *fsname, int *outfd);
     207extern int vfs_op_mtab_get(void);
     208extern int vfs_op_open(int fd, int flags);
     209extern int vfs_op_put(int fd);
     210extern int vfs_op_read(int fd, aoff64_t, size_t *out_bytes);
     211extern int vfs_op_rename(int basefd, char *old, char *new);
     212extern int vfs_op_resize(int fd, int64_t size);
     213extern int vfs_op_stat(int fd);
     214extern int vfs_op_statfs(int fd);
     215extern int vfs_op_sync(int fd);
     216extern int vfs_op_unlink(int parentfd, int expectfd, char *path);
     217extern int vfs_op_unmount(int mpfd);
     218extern int vfs_op_wait_handle(bool high_fd);
     219extern int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd);
     220extern int vfs_op_write(int fd, aoff64_t, size_t *out_bytes);
     221
    206222extern void vfs_register(ipc_callid_t, ipc_call_t *);
    207 extern void vfs_mount_srv(ipc_callid_t, ipc_call_t *);
    208 extern void vfs_unmount_srv(ipc_callid_t, ipc_call_t *);
    209 extern void vfs_open(ipc_callid_t, ipc_call_t *);
    210 extern void vfs_sync(ipc_callid_t, ipc_call_t *);
    211 extern void vfs_dup(ipc_callid_t, ipc_call_t *);
    212 extern void vfs_close(ipc_callid_t, ipc_call_t *);
    213 extern void vfs_read(ipc_callid_t, ipc_call_t *);
    214 extern void vfs_write(ipc_callid_t, ipc_call_t *);
    215 extern void vfs_seek(ipc_callid_t, ipc_call_t *);
    216 extern void vfs_truncate(ipc_callid_t, ipc_call_t *);
    217 extern void vfs_fstat(ipc_callid_t, ipc_call_t *);
    218 extern void vfs_stat(ipc_callid_t, ipc_call_t *);
    219 extern void vfs_mkdir(ipc_callid_t, ipc_call_t *);
    220 extern void vfs_unlink(ipc_callid_t, ipc_call_t *);
    221 extern void vfs_rename(ipc_callid_t, ipc_call_t *);
    222 extern void vfs_wait_handle(ipc_callid_t, ipc_call_t *);
    223 extern void vfs_get_mtab(ipc_callid_t, ipc_call_t *);
    224 extern void vfs_statfs(ipc_callid_t, ipc_call_t *);
    225223
    226224extern void vfs_page_in(ipc_callid_t, ipc_call_t *);
     
    231229} rdwr_io_chunk_t;
    232230
    233 extern int vfs_rdwr_internal(int, bool, rdwr_io_chunk_t *);
     231extern int vfs_rdwr_internal(int, aoff64_t, bool, rdwr_io_chunk_t *);
     232
     233extern void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg);
    234234
    235235#endif
Note: See TracChangeset for help on using the changeset viewer.