Changeset b38dfd8 in mainline
- Timestamp:
- 2010-12-06T19:40:52Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4006447
- Parents:
- bea023b9 (diff), c2f4b6b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/ipc/vfs.h
rbea023b9 rb38dfd8 36 36 #define LIBC_IPC_VFS_H_ 37 37 38 #include <ipc/ipc.h> 38 39 #include <sys/types.h> 39 #include < ipc/ipc.h>40 #include <bool.h> 40 41 41 42 #define FS_NAME_MAXLEN 20 … … 55 56 /** Unique identifier of the fs. */ 56 57 char name[FS_NAME_MAXLEN + 1]; 58 bool concurrent_read_write; 59 bool write_retains_size; 57 60 } vfs_info_t; 58 61 -
uspace/srv/fs/devfs/devfs.c
rbea023b9 rb38dfd8 53 53 static vfs_info_t devfs_vfs_info = { 54 54 .name = NAME, 55 .concurrent_read_write = false, 56 .write_retains_size = false, 55 57 }; 56 58 -
uspace/srv/fs/fat/fat.c
rbea023b9 rb38dfd8 52 52 vfs_info_t fat_vfs_info = { 53 53 .name = NAME, 54 .concurrent_read_write = false, 55 .write_retains_size = false, 54 56 }; 55 57 -
uspace/srv/fs/tmpfs/tmpfs.c
rbea023b9 rb38dfd8 57 57 vfs_info_t tmpfs_vfs_info = { 58 58 .name = NAME, 59 .concurrent_read_write = false, 60 .write_retains_size = false, 59 61 }; 60 62 -
uspace/srv/vfs/vfs.h
rbea023b9 rb38dfd8 172 172 173 173 extern fs_handle_t fs_name_to_handle(char *, bool); 174 extern vfs_info_t *fs_handle_to_info(fs_handle_t); 174 175 175 176 extern int vfs_lookup_internal(char *, int, vfs_lookup_res_t *, -
uspace/srv/vfs/vfs_ops.c
rbea023b9 rb38dfd8 781 781 static void vfs_rdwr(ipc_callid_t rid, ipc_call_t *request, bool read) 782 782 { 783 vfs_info_t *vi; 783 784 784 785 /* … … 807 808 fibril_mutex_lock(&file->lock); 808 809 810 vi = fs_handle_to_info(file->node->fs_handle); 811 assert(vi); 812 809 813 /* 810 814 * Lock the file's node so that no other client can read/write to it at 811 * the same time. 812 */ 813 if (read) 815 * the same time unless the FS supports concurrent reads/writes and its 816 * write implementation does not modify the file size. 817 */ 818 if (read || (vi->concurrent_read_write && vi->write_retains_size)) 814 819 fibril_rwlock_read_lock(&file->node->contents_rwlock); 815 820 else … … 857 862 858 863 /* Unlock the VFS node. */ 859 if (read )864 if (read || (vi->concurrent_read_write && vi->write_retains_size)) 860 865 fibril_rwlock_read_unlock(&file->node->contents_rwlock); 861 866 else { -
uspace/srv/vfs/vfs_register.c
rbea023b9 rb38dfd8 333 333 } 334 334 335 /** Find the VFS info structure. 336 * 337 * @param handle FS handle for which the VFS info structure is sought. 338 * @return VFS info structure on success or NULL otherwise. 339 */ 340 vfs_info_t *fs_handle_to_info(fs_handle_t handle) 341 { 342 vfs_info_t *info = NULL; 343 link_t *cur; 344 345 fibril_mutex_lock(&fs_head_lock); 346 for (cur = fs_head.next; cur != &fs_head; cur = cur->next) { 347 fs_info_t *fs = list_get_instance(cur, fs_info_t, fs_link); 348 if (fs->fs_handle == handle) { 349 info = &fs->vfs_info; 350 break; 351 } 352 } 353 fibril_mutex_unlock(&fs_head_lock); 354 355 return info; 356 } 357 335 358 /** 336 359 * @}
Note:
See TracChangeset
for help on using the changeset viewer.