Changeset 5126f80 in mainline for uspace/srv/vfs/vfs_file.c
- Timestamp:
- 2017-03-08T11:42:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- 0d35511
- Parents:
- a737667e
- git-author:
- Jiri Zarevucky <zarevucky.jiri@…> (2017-03-08 11:42:17)
- git-committer:
- Jakub Jermar <jakub@…> (2017-03-08 11:42:17)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs_file.c
ra737667e r5126f80 178 178 * endpoint FS and drop our reference to the underlying VFS node. 179 179 */ 180 if (file->open_read || file->open_write) { 181 rc = vfs_file_close_remote(file); 182 } 183 vfs_node_delref(file->node); 180 181 if (file->node != NULL) { 182 if (file->open_read || file->open_write) { 183 rc = vfs_file_close_remote(file); 184 } 185 vfs_node_delref(file->node); 186 } 184 187 free(file); 185 188 } … … 312 315 } 313 316 317 static void _vfs_file_put(vfs_client_data_t *vfs_data, vfs_file_t *file) 318 { 319 fibril_mutex_unlock(&file->_lock); 320 321 fibril_mutex_lock(&vfs_data->lock); 322 vfs_file_delref(vfs_data, file); 323 fibril_mutex_unlock(&vfs_data->lock); 324 } 325 314 326 static vfs_file_t *_vfs_file_get(vfs_client_data_t *vfs_data, int fd) 315 327 { … … 323 335 vfs_file_addref(vfs_data, file); 324 336 fibril_mutex_unlock(&vfs_data->lock); 337 325 338 fibril_mutex_lock(&file->_lock); 339 if (file->node == NULL) { 340 _vfs_file_put(vfs_data, file); 341 return NULL; 342 } 343 assert(file != NULL); 344 assert(file->node != NULL); 326 345 return file; 327 346 } … … 341 360 { 342 361 return _vfs_file_get(VFS_DATA, fd); 343 }344 345 static void _vfs_file_put(vfs_client_data_t *vfs_data, vfs_file_t *file)346 {347 fibril_mutex_unlock(&file->_lock);348 349 fibril_mutex_lock(&vfs_data->lock);350 vfs_file_delref(vfs_data, file);351 fibril_mutex_unlock(&vfs_data->lock);352 362 } 353 363
Note:
See TracChangeset
for help on using the changeset viewer.