Changeset 677745a in mainline for uspace/srv/vfs
- Timestamp:
- 2013-07-29T12:54:39Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5bcd5b7
- Parents:
- b7c62a9
- Location:
- uspace/srv/vfs
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.h
rb7c62a9 r677745a 113 113 vfs_node_type_t type; /**< Partial info about the node type. */ 114 114 115 aoff64_t size; /**< Cached size if the node is a file. */115 int64_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 int64_t vfs_node_get_size(vfs_node_t *node); 187 188 188 189 #define MAX_OPEN_FILES 128 -
uspace/srv/vfs/vfs_lookup.c
rb7c62a9 r677745a 270 270 } 271 271 272 unsigned last = IPC_GET_ARG3(answer); 273 if (last != first + len) { 274 /* The path wasn't processed entirely. */ 275 rc = ENOENT; 276 goto out; 277 } 278 272 279 if (!result) { 273 280 rc = EOK; … … 278 285 result->triplet.service_id = (service_id_t) IPC_GET_ARG1(answer); 279 286 result->triplet.index = (fs_index_t) IPC_GET_ARG2(answer); 280 result->size = 281 (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(answer), IPC_GET_ARG4(answer)); 287 result->size = (int64_t)(int32_t) IPC_GET_ARG4(answer); 282 288 result->type = IPC_GET_ARG5(answer); 283 289 rc = EOK; -
uspace/srv/vfs/vfs_node.c
rb7c62a9 r677745a 45 45 #include <async.h> 46 46 #include <errno.h> 47 #include <macros.h> 47 48 48 49 /** Mutex protecting the VFS node hash table. */ … … 300 301 } 301 302 303 int64_t vfs_node_get_size(vfs_node_t *node) 304 { 305 if (node->size == -1) { 306 sysarg_t sz1 = 0; 307 sysarg_t sz2 = 0; 308 309 async_exch_t *exch = vfs_exchange_grab(node->fs_handle); 310 (void) async_req_2_2(exch, VFS_OUT_GET_SIZE, 311 node->service_id, node->index, &sz1, &sz2); 312 vfs_exchange_release(exch); 313 314 node->size = MERGE_LOUP32(sz1, sz2); 315 } 316 return node->size; 317 } 318 302 319 /** 303 320 * @} -
uspace/srv/vfs/vfs_ops.c
rb7c62a9 r677745a 840 840 } else { 841 841 if (file->append) 842 file->pos = file->node->size;842 file->pos = vfs_node_get_size(file->node); 843 843 844 844 rc = async_data_write_forward_4_1(fs_exch, VFS_OUT_WRITE, … … 942 942 case SEEK_END: 943 943 fibril_rwlock_read_lock(&file->node->contents_rwlock); 944 aoff64_t size = file->node->size;944 aoff64_t size = vfs_node_get_size(file->node); 945 945 946 946 if ((off >= 0) && (size + off < size)) {
Note:
See TracChangeset
for help on using the changeset viewer.