Changes in / [b38dfd8:bea023b9] in mainline
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/ipc/vfs.h
rb38dfd8 rbea023b9 36 36 #define LIBC_IPC_VFS_H_ 37 37 38 #include <sys/types.h> 38 39 #include <ipc/ipc.h> 39 #include <sys/types.h>40 #include <bool.h>41 40 42 41 #define FS_NAME_MAXLEN 20 … … 56 55 /** Unique identifier of the fs. */ 57 56 char name[FS_NAME_MAXLEN + 1]; 58 bool concurrent_read_write;59 bool write_retains_size;60 57 } vfs_info_t; 61 58 -
uspace/srv/fs/devfs/devfs.c
rb38dfd8 rbea023b9 53 53 static vfs_info_t devfs_vfs_info = { 54 54 .name = NAME, 55 .concurrent_read_write = false,56 .write_retains_size = false,57 55 }; 58 56 -
uspace/srv/fs/fat/fat.c
rb38dfd8 rbea023b9 52 52 vfs_info_t fat_vfs_info = { 53 53 .name = NAME, 54 .concurrent_read_write = false,55 .write_retains_size = false,56 54 }; 57 55 -
uspace/srv/fs/tmpfs/tmpfs.c
rb38dfd8 rbea023b9 57 57 vfs_info_t tmpfs_vfs_info = { 58 58 .name = NAME, 59 .concurrent_read_write = false,60 .write_retains_size = false,61 59 }; 62 60 -
uspace/srv/vfs/vfs.h
rb38dfd8 rbea023b9 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);175 174 176 175 extern int vfs_lookup_internal(char *, int, vfs_lookup_res_t *, -
uspace/srv/vfs/vfs_ops.c
rb38dfd8 rbea023b9 781 781 static void vfs_rdwr(ipc_callid_t rid, ipc_call_t *request, bool read) 782 782 { 783 vfs_info_t *vi;784 783 785 784 /* … … 808 807 fibril_mutex_lock(&file->lock); 809 808 810 vi = fs_handle_to_info(file->node->fs_handle);811 assert(vi);812 813 809 /* 814 810 * Lock the file's node so that no other client can read/write to it at 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)) 811 * the same time. 812 */ 813 if (read) 819 814 fibril_rwlock_read_lock(&file->node->contents_rwlock); 820 815 else … … 862 857 863 858 /* Unlock the VFS node. */ 864 if (read || (vi->concurrent_read_write && vi->write_retains_size))859 if (read) 865 860 fibril_rwlock_read_unlock(&file->node->contents_rwlock); 866 861 else { -
uspace/srv/vfs/vfs_register.c
rb38dfd8 rbea023b9 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 358 335 /** 359 336 * @}
Note:
See TracChangeset
for help on using the changeset viewer.