Changeset 368ee04 in mainline for uspace/srv/vfs/vfs.h
- Timestamp:
- 2017-04-05T18:10:39Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 93ad8166
- Parents:
- 39f892a9 (diff), 2166728 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.h
r39f892a9 r368ee04 94 94 vfs_node_type_t type; 95 95 aoff64_t size; 96 unsigned int lnkcnt;97 96 } vfs_lookup_res_t; 98 97 … … 101 100 * which may be associated with it. 102 101 */ 103 typedef struct {102 typedef struct _vfs_node { 104 103 VFS_TRIPLET; /**< Identity of the node. */ 105 104 … … 110 109 unsigned refcnt; 111 110 112 /** Number of names this node has in the file system namespace. */113 unsigned lnkcnt;114 115 111 ht_link_t nh_link; /**< Node hash-table link. */ 116 112 … … 123 119 */ 124 120 fibril_rwlock_t contents_rwlock; 121 122 struct _vfs_node *mount; 125 123 } vfs_node_t; 126 124 … … 131 129 typedef struct { 132 130 /** Serializes access to this open file. */ 133 fibril_mutex_t lock;131 fibril_mutex_t _lock; 134 132 135 133 vfs_node_t *node; … … 138 136 unsigned refcnt; 139 137 138 int permissions; 139 bool open_read; 140 bool open_write; 141 140 142 /** Append on write. */ 141 143 bool append; 142 143 /** Current absolute position in the file. */144 aoff64_t pos;145 144 } vfs_file_t; 146 145 … … 173 172 extern void vfs_exchange_release(async_exch_t *); 174 173 175 extern fs_handle_t fs_name_to_handle(unsigned int instance, c har *, bool);174 extern fs_handle_t fs_name_to_handle(unsigned int instance, const char *, bool); 176 175 extern vfs_info_t *fs_handle_to_info(fs_handle_t); 177 176 178 extern int vfs_lookup_internal( char *, int, vfs_lookup_res_t *,179 vfs_pair_t *, ...);177 extern int vfs_lookup_internal(vfs_node_t *, char *, int, vfs_lookup_res_t *); 178 extern int vfs_link_internal(vfs_node_t *, char *, vfs_triplet_t *); 180 179 181 180 extern bool vfs_nodes_init(void); 182 181 extern vfs_node_t *vfs_node_get(vfs_lookup_res_t *); 182 extern vfs_node_t *vfs_node_peek(vfs_lookup_res_t *result); 183 183 extern void vfs_node_put(vfs_node_t *); 184 184 extern void vfs_node_forget(vfs_node_t *); 185 185 extern unsigned vfs_nodes_refcount_sum_get(fs_handle_t, service_id_t); 186 186 187 188 #define MAX_OPEN_FILES 128 187 extern bool vfs_node_has_children(vfs_node_t *node); 189 188 190 189 extern void *vfs_client_data_create(void); 191 190 extern void vfs_client_data_destroy(void *); 192 191 193 extern void vfs_ pass_handle(task_id_t, task_id_t, int);194 extern int vfs_wait_handle_internal( void);192 extern void vfs_op_pass_handle(task_id_t, task_id_t, int); 193 extern int vfs_wait_handle_internal(bool); 195 194 196 195 extern vfs_file_t *vfs_file_get(int); 197 196 extern void vfs_file_put(vfs_file_t *); 198 197 extern int vfs_fd_assign(vfs_file_t *, int); 199 extern int vfs_fd_alloc( bool desc);198 extern int vfs_fd_alloc(vfs_file_t **file, bool desc); 200 199 extern int vfs_fd_free(int); 201 200 … … 204 203 extern int vfs_open_node_remote(vfs_node_t *); 205 204 205 extern int vfs_op_clone(int oldfd, int newfd, bool desc); 206 extern int vfs_op_mount(int mpfd, unsigned servid, unsigned flags, unsigned instance, const char *opts, const char *fsname, int *outfd); 207 extern int vfs_op_mtab_get(void); 208 extern int vfs_op_open(int fd, int flags); 209 extern int vfs_op_put(int fd); 210 extern int vfs_op_read(int fd, aoff64_t, size_t *out_bytes); 211 extern int vfs_op_rename(int basefd, char *old, char *new); 212 extern int vfs_op_resize(int fd, int64_t size); 213 extern int vfs_op_stat(int fd); 214 extern int vfs_op_statfs(int fd); 215 extern int vfs_op_sync(int fd); 216 extern int vfs_op_unlink(int parentfd, int expectfd, char *path); 217 extern int vfs_op_unmount(int mpfd); 218 extern int vfs_op_wait_handle(bool high_fd); 219 extern int vfs_op_walk(int parentfd, int flags, char *path, int *out_fd); 220 extern int vfs_op_write(int fd, aoff64_t, size_t *out_bytes); 221 206 222 extern 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 *);225 223 226 224 extern void vfs_page_in(ipc_callid_t, ipc_call_t *); … … 231 229 } rdwr_io_chunk_t; 232 230 233 extern int vfs_rdwr_internal(int, bool, rdwr_io_chunk_t *); 231 extern int vfs_rdwr_internal(int, aoff64_t, bool, rdwr_io_chunk_t *); 232 233 extern void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg); 234 234 235 235 #endif
Note:
See TracChangeset
for help on using the changeset viewer.