Changeset f2ec8c8 in mainline for uspace/srv/vfs
- Timestamp:
- 2008-03-11T20:33:53Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 923c39e
- Parents:
- 8ad8e49
- Location:
- uspace/srv/vfs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.h
r8ad8e49 rf2ec8c8 47 47 #define IPC_METHOD_TO_VFS_OP(m) ((m) - VFS_FIRST) 48 48 49 /* Basic types. */ 50 typedef int16_t fs_handle_t; 51 typedef int16_t dev_handle_t; 52 typedef uint32_t fs_index_t; 53 49 54 typedef enum { 50 55 VFS_READ = VFS_FIRST, … … 107 112 link_t fs_link; 108 113 vfs_info_t vfs_info; 109 int fs_handle;114 fs_handle_t fs_handle; 110 115 futex_t phone_futex; /**< Phone serializing futex. */ 111 116 ipcarg_t phone; … … 115 120 * VFS_PAIR uniquely represents a file system instance. 116 121 */ 117 #define VFS_PAIR \118 int fs_handle; \119 int dev_handle;122 #define VFS_PAIR \ 123 fs_handle_t fs_handle; \ 124 dev_handle_t dev_handle; 120 125 121 126 /** … … 128 133 #define VFS_TRIPLET \ 129 134 VFS_PAIR; \ 130 uint64_t index;135 fs_index_t index; 131 136 132 137 typedef struct { … … 257 262 extern rwlock_t namespace_rwlock; 258 263 259 extern int vfs_grab_phone( int);264 extern int vfs_grab_phone(fs_handle_t); 260 265 extern void vfs_release_phone(int); 261 266 262 extern int fs_name_to_handle(char *, bool);267 extern fs_handle_t fs_name_to_handle(char *, bool); 263 268 264 269 extern int vfs_lookup_internal(char *, int, vfs_lookup_res_t *, vfs_pair_t *, -
uspace/srv/vfs/vfs_lookup.c
r8ad8e49 rf2ec8c8 83 83 return EINVAL; 84 84 85 uint64_t index = 0;85 fs_index_t index = 0; 86 86 if (lflag & L_LINK) { 87 87 va_list ap; 88 88 89 89 va_start(ap, altroot); 90 index = va_arg(ap, uint64_t);90 index = va_arg(ap, fs_index_t); 91 91 va_end(ap); 92 92 } … … 178 178 179 179 if ((rc == EOK) && result) { 180 result->triplet.fs_handle = ( int) IPC_GET_ARG1(answer);181 result->triplet.dev_handle = ( int) IPC_GET_ARG2(answer);182 result->triplet.index = ( uint64_t) IPC_GET_ARG3(answer);180 result->triplet.fs_handle = (fs_handle_t) IPC_GET_ARG1(answer); 181 result->triplet.dev_handle = (dev_handle_t) IPC_GET_ARG2(answer); 182 result->triplet.index = (fs_index_t) IPC_GET_ARG3(answer); 183 183 result->size = (size_t) IPC_GET_ARG4(answer); 184 184 result->lnkcnt = (unsigned) IPC_GET_ARG5(answer); -
uspace/srv/vfs/vfs_ops.c
r8ad8e49 rf2ec8c8 54 54 55 55 /* Forward declarations of static functions. */ 56 static int vfs_truncate_internal( int, int, unsigned long, size_t);56 static int vfs_truncate_internal(fs_handle_t, dev_handle_t, fs_index_t, size_t); 57 57 58 58 /** … … 69 69 }; 70 70 71 static int lookup_root(int fs_handle, int dev_handle, vfs_lookup_res_t *result) 71 static int 72 lookup_root(fs_handle_t fs_handle, dev_handle_t dev_handle, 73 vfs_lookup_res_t *result) 72 74 { 73 75 vfs_pair_t altroot = { … … 81 83 void vfs_mount(ipc_callid_t rid, ipc_call_t *request) 82 84 { 83 int dev_handle;85 dev_handle_t dev_handle; 84 86 vfs_node_t *mp_node = NULL; 85 87 … … 89 91 * in the request. 90 92 */ 91 dev_handle = IPC_GET_ARG1(*request);93 dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); 92 94 93 95 /* … … 128 130 * This will also give us its file system handle. 129 131 */ 130 int fs_handle = fs_name_to_handle(fs_name, true);132 fs_handle_t fs_handle = fs_name_to_handle(fs_name, true); 131 133 if (!fs_handle) { 132 134 ipc_answer_0(rid, ENOENT); … … 572 574 } 573 575 574 int vfs_truncate_internal(int fs_handle, int dev_handle, unsigned long index, 575 size_t size) 576 int 577 vfs_truncate_internal(fs_handle_t fs_handle, dev_handle_t dev_handle, 578 fs_index_t index, size_t size) 576 579 { 577 580 ipcarg_t rc; -
uspace/srv/vfs/vfs_register.c
r8ad8e49 rf2ec8c8 295 295 * system a global file system handle. 296 296 */ 297 fs_info->fs_handle = ( int) atomic_postinc(&fs_handle_next);297 fs_info->fs_handle = (fs_handle_t) atomic_postinc(&fs_handle_next); 298 298 ipc_answer_1(rid, EOK, (ipcarg_t) fs_info->fs_handle); 299 299 … … 312 312 * sent. Return 0 if no phone was found. 313 313 */ 314 int vfs_grab_phone( int handle)314 int vfs_grab_phone(fs_handle_t handle) 315 315 { 316 316 /* … … 387 387 * @return File system handle or zero if file system not found. 388 388 */ 389 int fs_name_to_handle(char *name, bool lock)389 fs_handle_t fs_name_to_handle(char *name, bool lock) 390 390 { 391 391 int handle = 0;
Note:
See TracChangeset
for help on using the changeset viewer.