Changeset 51774cd in mainline for uspace/srv/vfs
- Timestamp:
- 2017-04-04T21:31:40Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2166728
- Parents:
- 59f388a
- Location:
- uspace/srv/vfs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.h
r59f388a r51774cd 113 113 vfs_node_type_t type; /**< Partial info about the node type. */ 114 114 115 int64_t size; /**< Cached size if the node is a file. */115 aoff64_t size; /**< Cached size if the node is a file. */ 116 116 117 117 /** … … 185 185 extern unsigned vfs_nodes_refcount_sum_get(fs_handle_t, service_id_t); 186 186 187 extern int64_t vfs_node_get_size(vfs_node_t *node);188 187 extern bool vfs_node_has_children(vfs_node_t *node); 189 188 -
uspace/srv/vfs/vfs_lookup.c
r59f388a r51774cd 226 226 227 227 unsigned last = *pfirst + *plen; 228 *pfirst = IPC_GET_ARG3(answer) ;228 *pfirst = IPC_GET_ARG3(answer) & 0xffff; 229 229 *plen = last - *pfirst; 230 230 … … 232 232 result->triplet.service_id = (service_id_t) IPC_GET_ARG1(answer); 233 233 result->triplet.index = (fs_index_t) IPC_GET_ARG2(answer); 234 result->size = (int64_t)(int32_t) IPC_GET_ARG4(answer);235 result->type = IPC_GET_ARG5(answer) ?234 result->size = MERGE_LOUP32(IPC_GET_ARG4(answer), IPC_GET_ARG5(answer)); 235 result->type = (IPC_GET_ARG3(answer) >> 16) ? 236 236 VFS_NODE_DIRECTORY : VFS_NODE_FILE; 237 237 return EOK; -
uspace/srv/vfs/vfs_node.c
r59f388a r51774cd 315 315 } 316 316 317 int64_t vfs_node_get_size(vfs_node_t *node)318 {319 if (node->size == -1) {320 sysarg_t sz1 = 0;321 sysarg_t sz2 = 0;322 323 async_exch_t *exch = vfs_exchange_grab(node->fs_handle);324 (void) async_req_2_2(exch, VFS_OUT_GET_SIZE, node->service_id,325 node->index, &sz1, &sz2);326 vfs_exchange_release(exch);327 328 node->size = MERGE_LOUP32(sz1, sz2);329 }330 return node->size;331 }332 333 317 bool vfs_node_has_children(vfs_node_t *node) 334 318 { -
uspace/srv/vfs/vfs_ops.c
r59f388a r51774cd 439 439 async_exch_t *fs_exch = vfs_exchange_grab(file->node->fs_handle); 440 440 441 if (!read && file->append) { 442 if (file->node->size == -1) 443 file->node->size = vfs_node_get_size(file->node); 441 if (!read && file->append) 444 442 pos = file->node->size; 445 }446 443 447 444 /*
Note:
See TracChangeset
for help on using the changeset viewer.