Changeset 8d6a41c in mainline
- Timestamp:
- 2011-11-05T13:00:34Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 45ffe9f
- Parents:
- 72fda53
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/mount/mount.c
r72fda53 r8d6a41c 68 68 get_mtab_list(&mtab_list); 69 69 70 mtab_ list_ent_t *old_ent = NULL;70 mtab_ent_t *old_ent = NULL; 71 71 72 72 list_foreach(mtab_list, cur) { 73 mtab_ list_ent_t *ent = list_get_instance(cur, mtab_list_ent_t,73 mtab_ent_t *mtab_ent = list_get_instance(cur, mtab_ent_t, 74 74 link); 75 76 mtab_ent_t *mtab_ent = &ent->mtab_ent;77 75 78 76 if (old_ent) 79 77 free(old_ent); 80 78 81 old_ent = ent;79 old_ent = mtab_ent; 82 80 83 81 printf("%s on %s ", mtab_ent->fs_name, mtab_ent->mp); -
uspace/lib/c/generic/vfs/vfs.c
r72fda53 r8d6a41c 35 35 #include <vfs/canonify.h> 36 36 #include <vfs/vfs.h> 37 #include <vfs/vfs_mtab.h>38 37 #include <vfs/vfs_sess.h> 39 38 #include <macros.h> … … 849 848 850 849 for (i = 0; i < num_mounted_fs; ++i) { 851 mtab_list_ent_t *mtab_list_ent;852 850 mtab_ent_t *mtab_ent; 853 851 854 mtab_ list_ent = malloc(sizeof(mtab_list_ent_t));855 if (!mtab_ list_ent) {852 mtab_ent = malloc(sizeof(mtab_ent_t)); 853 if (!mtab_ent) { 856 854 rc = ENOMEM; 857 855 goto exit; 858 856 } 859 857 860 memset(mtab_list_ent, 0, sizeof(mtab_list_ent_t)); 861 862 mtab_ent = &mtab_list_ent->mtab_ent; 858 memset(mtab_ent, 0, sizeof(mtab_ent_t)); 863 859 864 860 rc = async_data_read_start(exch, (void *) mtab_ent->mp, … … 890 886 mtab_ent->fs_handle = p[2]; 891 887 892 link_initialize(&mtab_ list_ent->link);893 list_append(&mtab_ list_ent->link, mtab_list);888 link_initialize(&mtab_ent->link); 889 list_append(&mtab_ent->link, mtab_list); 894 890 } 895 891 -
uspace/lib/c/include/vfs/vfs_mtab.h
r72fda53 r8d6a41c 40 40 41 41 typedef struct mtab_ent { 42 link_t link; 42 43 char mp[MAX_PATH_LEN]; 43 44 char opts[MAX_MNTOPTS_LEN]; … … 48 49 } mtab_ent_t; 49 50 50 typedef struct mtab_list_ent {51 link_t link;52 mtab_ent_t mtab_ent;53 } mtab_list_ent_t;54 55 51 #endif 56 52 -
uspace/srv/vfs/vfs_ops.c
r72fda53 r8d6a41c 362 362 363 363 /* Add the filesystem info to the list of mounted filesystems */ 364 mtab_ list_ent_t *mtab_list_ent = malloc(sizeof(mtab_list_ent_t));365 if (!mtab_ list_ent) {364 mtab_ent_t *mtab_ent = malloc(sizeof(mtab_ent_t)); 365 if (!mtab_ent) { 366 366 async_answer_0(callid, ENOMEM); 367 367 async_answer_0(rid, ENOMEM); … … 371 371 return; 372 372 } 373 374 mtab_ent_t *mtab_ent = &mtab_list_ent->mtab_ent;375 373 376 374 mtab_ent->fs_handle = fs_handle; … … 381 379 mtab_ent->instance = instance; 382 380 383 link_initialize(&mtab_ list_ent->link);381 link_initialize(&mtab_ent->link); 384 382 385 383 fibril_mutex_lock(&mtab_list_lock); 386 list_append(&mtab_ list_ent->link, &mtab_list);384 list_append(&mtab_ent->link, &mtab_list); 387 385 mtab_size++; 388 386 fibril_mutex_unlock(&mtab_list_lock); … … 538 536 539 537 list_foreach(mtab_list, cur) { 540 mtab_ list_ent_t *ent = list_get_instance(cur, mtab_list_ent_t,538 mtab_ent_t *mtab_ent = list_get_instance(cur, mtab_ent_t, 541 539 link); 542 540 543 mtab_ent_t *mtab_ent = &ent->mtab_ent;544 545 541 if (str_cmp(mtab_ent->mp, mp) == 0) { 546 list_remove(& ent->link);542 list_remove(&mtab_ent->link); 547 543 mtab_size--; 548 free( ent);544 free(mtab_ent); 549 545 found = 1; 550 546 break; … … 1363 1359 1364 1360 list_foreach(mtab_list, cur) { 1365 mtab_ list_ent_t *ent = list_get_instance(cur, mtab_list_ent_t,1361 mtab_ent_t *mtab_ent = list_get_instance(cur, mtab_ent_t, 1366 1362 link); 1367 1368 mtab_ent_t *mtab_ent = &ent->mtab_ent;1369 1363 1370 1364 rc = ENOTSUP;
Note:
See TracChangeset
for help on using the changeset viewer.