Changes in uspace/srv/vfs/vfs.h [852b801:ffa2c8ef] in mainline


Ignore:
File:
1 edited

Legend:

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

    r852b801 rffa2c8ef  
    3434#define VFS_VFS_H_
    3535
    36 #include <ipc/ipc.h>
     36#include <async.h>
    3737#include <adt/list.h>
    38 #include <fibril_sync.h>
     38#include <fibril_synch.h>
    3939#include <sys/types.h>
    4040#include <devmap.h>
     
    4242#include <ipc/vfs.h>
    4343
    44 // FIXME: according to CONFIG_DEBUG
    45 // #define dprintf(...)  printf(__VA_ARGS__)
    46 
    47 #define dprintf(...)
     44#ifndef dprintf
     45        #define dprintf(...)
     46#endif
    4847
    4948/**
     
    5453        vfs_info_t vfs_info;
    5554        fs_handle_t fs_handle;
    56         fibril_mutex_t phone_lock;
    57         ipcarg_t phone;
     55        async_sess_t session;
    5856} fs_info_t;
    5957
     
    6361#define VFS_PAIR \
    6462        fs_handle_t fs_handle; \
    65         dev_handle_t dev_handle;
     63        devmap_handle_t devmap_handle;
    6664
    6765/**
     
    6967 * doesn't contain any state. For a stateful structure, see vfs_node_t.
    7068 *
    71  * @note        fs_handle, dev_handle and index are meant to be returned in one
     69 * @note        fs_handle, devmap_handle and index are meant to be returned in one
    7270 *              IPC reply.
    7371 */
     
    9391        vfs_triplet_t triplet;
    9492        vfs_node_type_t type;
    95         size_t size;
    96         unsigned lnkcnt;
     93        aoff64_t size;
     94        unsigned int lnkcnt;
    9795} vfs_lookup_res_t;
    9896
     
    117115        vfs_node_type_t type;   /**< Partial info about the node type. */
    118116
    119         size_t size;            /**< Cached size if the node is a file. */
     117        aoff64_t size;          /**< Cached size if the node is a file. */
    120118
    121119        /**
     
    141139        bool append;
    142140
    143         /** Current position in the file. */
    144         off_t pos;
     141        /** Current absolute position in the file. */
     142        aoff64_t pos;
    145143} vfs_file_t;
    146144
     
    170168
    171169extern int vfs_grab_phone(fs_handle_t);
    172 extern void vfs_release_phone(int);
     170extern void vfs_release_phone(fs_handle_t, int);
    173171
    174172extern fs_handle_t fs_name_to_handle(char *, bool);
     173extern vfs_info_t *fs_handle_to_info(fs_handle_t);
    175174
    176175extern int vfs_lookup_internal(char *, int, vfs_lookup_res_t *,
    177176    vfs_pair_t *, ...);
    178177extern int vfs_open_node_internal(vfs_lookup_res_t *);
     178extern int vfs_close_internal(vfs_file_t *);
    179179
    180180extern bool vfs_nodes_init(void);
    181181extern vfs_node_t *vfs_node_get(vfs_lookup_res_t *);
    182182extern void vfs_node_put(vfs_node_t *);
     183extern void vfs_node_forget(vfs_node_t *);
     184extern unsigned vfs_nodes_refcount_sum_get(fs_handle_t, devmap_handle_t);
     185
    183186
    184187#define MAX_OPEN_FILES  128
    185188
    186 extern bool vfs_files_init(void);
     189extern void *vfs_client_data_create(void);
     190extern void vfs_client_data_destroy(void *);
     191
    187192extern vfs_file_t *vfs_file_get(int);
    188 extern int vfs_fd_alloc(void);
     193extern void vfs_file_put(vfs_file_t *);
     194extern int vfs_fd_assign(vfs_file_t *, int);
     195extern int vfs_fd_alloc(bool desc);
    189196extern int vfs_fd_free(int);
    190 
    191 extern void vfs_file_addref(vfs_file_t *);
    192 extern void vfs_file_delref(vfs_file_t *);
    193197
    194198extern void vfs_node_addref(vfs_node_t *);
     
    197201extern void vfs_register(ipc_callid_t, ipc_call_t *);
    198202extern void vfs_mount(ipc_callid_t, ipc_call_t *);
     203extern void vfs_unmount(ipc_callid_t, ipc_call_t *);
    199204extern void vfs_open(ipc_callid_t, ipc_call_t *);
    200205extern void vfs_open_node(ipc_callid_t, ipc_call_t *);
    201206extern void vfs_sync(ipc_callid_t, ipc_call_t *);
     207extern void vfs_dup(ipc_callid_t, ipc_call_t *);
    202208extern void vfs_close(ipc_callid_t, ipc_call_t *);
    203209extern void vfs_read(ipc_callid_t, ipc_call_t *);
     
    206212extern void vfs_truncate(ipc_callid_t, ipc_call_t *);
    207213extern void vfs_fstat(ipc_callid_t, ipc_call_t *);
    208 extern void vfs_fstat(ipc_callid_t, ipc_call_t *);
    209214extern void vfs_stat(ipc_callid_t, ipc_call_t *);
    210215extern void vfs_mkdir(ipc_callid_t, ipc_call_t *);
Note: See TracChangeset for help on using the changeset viewer.