Changeset 35b7d86e in mainline for uspace/lib/c/generic/vfs/vfs.c
- Timestamp:
- 2017-03-13T20:33:06Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8ffedd8
- Parents:
- ea56098
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
rea56098 r35b7d86e 1106 1106 int vfs_get_mtab_list(list_t *mtab_list) 1107 1107 { 1108 sysarg_t rc; 1109 aid_t req; 1110 size_t i; 1111 sysarg_t num_mounted_fs; 1112 1113 async_exch_t *exch = vfs_exchange_begin(); 1114 1115 req = async_send_0(exch, VFS_IN_MTAB_GET, NULL); 1116 1117 /* Ask VFS how many filesystems are mounted */ 1118 rc = async_req_0_1(exch, VFS_IN_PING, &num_mounted_fs); 1119 if (rc != EOK) 1120 goto exit; 1121 1122 for (i = 0; i < num_mounted_fs; ++i) { 1123 mtab_ent_t *mtab_ent; 1124 1125 mtab_ent = malloc(sizeof(mtab_ent_t)); 1126 if (mtab_ent == NULL) { 1127 rc = ENOMEM; 1128 goto exit; 1129 } 1130 1131 memset(mtab_ent, 0, sizeof(mtab_ent_t)); 1132 1133 rc = async_data_read_start(exch, (void *) mtab_ent->mp, 1134 MAX_PATH_LEN); 1135 if (rc != EOK) 1136 goto exit; 1137 1138 rc = async_data_read_start(exch, (void *) mtab_ent->opts, 1139 MAX_MNTOPTS_LEN); 1140 if (rc != EOK) 1141 goto exit; 1142 1143 rc = async_data_read_start(exch, (void *) mtab_ent->fs_name, 1144 FS_NAME_MAXLEN); 1145 if (rc != EOK) 1146 goto exit; 1147 1148 sysarg_t p[2]; 1149 1150 rc = async_req_0_2(exch, VFS_IN_PING, &p[0], &p[1]); 1151 if (rc != EOK) 1152 goto exit; 1153 1154 mtab_ent->instance = p[0]; 1155 mtab_ent->service_id = p[1]; 1156 1157 link_initialize(&mtab_ent->link); 1158 list_append(&mtab_ent->link, mtab_list); 1159 } 1160 1161 exit: 1162 async_wait_for(req, &rc); 1163 vfs_exchange_end(exch); 1108 sysarg_t rc = ENOTSUP; 1109 1164 1110 return rc; 1165 1111 }
Note:
See TracChangeset
for help on using the changeset viewer.