Changeset 44451ee in mainline
- Timestamp:
- 2011-08-18T15:32:40Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 221ab41a
- Parents:
- 27b76ca
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/ipc/vfs.h
r27b76ca r44451ee 82 82 83 83 typedef enum { 84 VFS_OUT_READ = IPC_FIRST_USER_METHOD, 84 VFS_OUT_OPEN_NODE = IPC_FIRST_USER_METHOD, 85 VFS_OUT_READ, 85 86 VFS_OUT_WRITE, 86 87 VFS_OUT_TRUNCATE, -
uspace/lib/fs/libfs.c
r27b76ca r44451ee 72 72 ipc_call_t *); 73 73 static void libfs_stat(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); 74 static void libfs_open_node(libfs_ops_t *, fs_handle_t, ipc_callid_t, 75 ipc_call_t *); 74 76 75 77 static void vfs_out_mounted(ipc_callid_t rid, ipc_call_t *req) … … 196 198 } 197 199 200 static void vfs_out_open_node(ipc_callid_t rid, ipc_call_t *req) 201 { 202 libfs_open_node(libfs_ops, reg.fs_handle, rid, req); 203 } 204 198 205 static void vfs_out_stat(ipc_callid_t rid, ipc_call_t *req) 199 206 { … … 260 267 case VFS_OUT_DESTROY: 261 268 vfs_out_destroy(callid, &call); 269 break; 270 case VFS_OUT_OPEN_NODE: 271 vfs_out_open_node(callid, &call); 262 272 break; 263 273 case VFS_OUT_STAT: … … 835 845 } 836 846 847 /** Open VFS triplet. 848 * 849 * @param ops libfs operations structure with function pointers to 850 * file system implementation 851 * @param rid Request ID of the VFS_OUT_OPEN_NODE request. 852 * @param request VFS_OUT_OPEN_NODE request data itself. 853 * 854 */ 855 void libfs_open_node(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid, 856 ipc_call_t *request) 857 { 858 devmap_handle_t devmap_handle = IPC_GET_ARG1(*request); 859 fs_index_t index = IPC_GET_ARG2(*request); 860 861 fs_node_t *fn; 862 int rc = ops->node_get(&fn, devmap_handle, index); 863 on_error(rc, answer_and_return(rid, rc)); 864 865 if (fn == NULL) { 866 async_answer_0(rid, ENOENT); 867 return; 868 } 869 870 rc = ops->node_open(fn); 871 aoff64_t size = ops->size_get(fn); 872 async_answer_4(rid, rc, LOWER32(size), UPPER32(size), 873 ops->lnkcnt_get(fn), 874 (ops->is_file(fn) ? L_FILE : 0) | (ops->is_directory(fn) ? L_DIRECTORY : 0)); 875 876 (void) ops->node_put(fn); 877 } 878 837 879 /** @} 838 880 */ -
uspace/srv/vfs/vfs.h
r27b76ca r44451ee 199 199 extern void vfs_node_addref(vfs_node_t *); 200 200 extern void vfs_node_delref(vfs_node_t *); 201 extern int vfs_open_node_remote(vfs_node_t *); 201 202 202 203 extern void vfs_register(ipc_callid_t, ipc_call_t *); -
uspace/srv/vfs/vfs_node.c
r27b76ca r44451ee 293 293 } 294 294 295 296 /** Perform a remote node open operation. 297 * 298 * @return EOK on success or an error code from errno.h. 299 * 300 */ 301 int vfs_open_node_remote(vfs_node_t *node) 302 { 303 async_exch_t *exch = vfs_exchange_grab(node->fs_handle); 304 305 ipc_call_t answer; 306 aid_t req = async_send_2(exch, VFS_OUT_OPEN_NODE, 307 (sysarg_t) node->devmap_handle, (sysarg_t) node->index, &answer); 308 309 vfs_exchange_release(exch); 310 311 sysarg_t rc; 312 async_wait_for(req, &rc); 313 314 return rc; 315 } 316 295 317 /** 296 318 * @}
Note:
See TracChangeset
for help on using the changeset viewer.