Changeset 677745a in mainline for uspace/lib/fs/libfs.c
- Timestamp:
- 2013-07-29T12:54:39Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5bcd5b7
- Parents:
- b7c62a9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/fs/libfs.c
rb7c62a9 r677745a 238 238 } 239 239 240 static void vfs_out_get_size(ipc_callid_t rid, ipc_call_t *req) 241 { 242 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 243 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 244 int rc; 245 246 fs_node_t *node = NULL; 247 rc = libfs_ops->node_get(&node, service_id, index); 248 if (rc != EOK) { 249 async_answer_0(rid, rc); 250 } 251 if (node == NULL) { 252 async_answer_0(rid, EINVAL); 253 } 254 255 uint64_t size = libfs_ops->size_get(node); 256 libfs_ops->node_put(node); 257 258 async_answer_2(rid, EOK, LOWER32(size), UPPER32(size)); 259 } 260 240 261 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 241 262 { … … 299 320 vfs_out_sync(callid, &call); 300 321 break; 322 case VFS_OUT_GET_SIZE: 323 vfs_out_get_size(callid, &call); 324 break; 301 325 default: 302 326 async_answer_0(callid, ENOTSUP); … … 657 681 /* Find the file and its parent. */ 658 682 683 unsigned last_next = 0; 684 659 685 while (next != last) { 660 686 if (cur == NULL) { 661 as ync_answer_0(rid, ENOENT);662 LOG_EXIT(ENOENT);663 goto out;664 } 687 assert(par != NULL); 688 goto out1; 689 } 690 665 691 if (!ops->is_directory(cur)) { 666 692 async_answer_0(rid, ENOTDIR); … … 669 695 } 670 696 697 last_next = next; 671 698 /* Collect the component */ 672 699 rc = plb_get_component(component, &clen, &next, last); … … 773 800 rc = ops->unlink(par, cur, component); 774 801 if (rc == EOK) { 775 aoff64_t size = ops->size_get(cur); 802 int64_t size = ops->size_get(cur); 803 int32_t lsize = LOWER32(size); 804 if (lsize != size) { 805 lsize = -1; 806 } 807 776 808 async_answer_5(rid, fs_handle, service_id, 777 ops->index_get(cur), LOWER32(size), UPPER32(size),809 ops->index_get(cur), last, lsize, 778 810 ops->is_directory(cur) ? VFS_NODE_DIRECTORY : VFS_NODE_FILE); 779 811 LOG_EXIT(EOK); … … 819 851 820 852 /* Return. */ 821 853 out1: 822 854 if (!cur) { 855 async_answer_5(rid, fs_handle, service_id, 856 ops->index_get(par), last_next, -1, VFS_NODE_DIRECTORY); 857 LOG_EXIT(EOK); 858 /* 823 859 async_answer_0(rid, ENOENT); 824 860 LOG_EXIT(ENOENT); 861 */ 825 862 goto out; 826 863 } … … 835 872 } 836 873 837 aoff64_t size = ops->size_get(cur); 874 int64_t size = ops->size_get(cur); 875 int32_t lsize = LOWER32(size); 876 if (lsize != size) { 877 lsize = -1; 878 } 879 838 880 async_answer_5(rid, fs_handle, service_id, 839 ops->index_get(cur), LOWER32(size), UPPER32(size),881 ops->index_get(cur), last, lsize, 840 882 ops->is_directory(cur) ? VFS_NODE_DIRECTORY : VFS_NODE_FILE); 841 883
Note:
See TracChangeset
for help on using the changeset viewer.