Changes in uspace/srv/volsrv/volsrv.c [1433ecda:1a9174e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/volsrv/volsrv.c
r1433ecda r1a9174e 144 144 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_info_srv(%zu)", 145 145 sid); 146 rc = vol_part_find_by_id (sid, &part);146 rc = vol_part_find_by_id_ref(sid, &part); 147 147 if (rc != EOK) { 148 148 async_answer_0(icall_handle, ENOENT); … … 153 153 if (rc != EOK) { 154 154 async_answer_0(icall_handle, EIO); 155 return;155 goto error; 156 156 } 157 157 … … 161 161 async_answer_0(chandle, EREFUSED); 162 162 async_answer_0(icall_handle, EREFUSED); 163 return;163 goto error; 164 164 } 165 165 … … 167 167 async_answer_0(chandle, EINVAL); 168 168 async_answer_0(icall_handle, EINVAL); 169 return;169 goto error; 170 170 } 171 171 … … 175 175 async_answer_0(chandle, rc); 176 176 async_answer_0(icall_handle, rc); 177 return; 178 } 179 180 async_answer_0(icall_handle, EOK); 177 goto error; 178 } 179 180 async_answer_0(icall_handle, EOK); 181 error: 182 vol_part_del_ref(part); 183 } 184 185 static void vol_part_eject_srv(cap_call_handle_t icall_handle, ipc_call_t *icall) 186 { 187 service_id_t sid; 188 vol_part_t *part; 189 errno_t rc; 190 191 sid = IPC_GET_ARG1(*icall); 192 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_eject_srv(%zu)", sid); 193 194 rc = vol_part_find_by_id_ref(sid, &part); 195 if (rc != EOK) { 196 async_answer_0(icall_handle, ENOENT); 197 goto error; 198 } 199 200 rc = vol_part_eject_part(part); 201 if (rc != EOK) { 202 async_answer_0(icall_handle, EIO); 203 goto error; 204 } 205 206 async_answer_0(icall_handle, EOK); 207 error: 208 vol_part_del_ref(part); 181 209 } 182 210 … … 190 218 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_empty_srv(%zu)", sid); 191 219 192 rc = vol_part_find_by_id (sid, &part);220 rc = vol_part_find_by_id_ref(sid, &part); 193 221 if (rc != EOK) { 194 222 async_answer_0(icall_handle, ENOENT); … … 199 227 if (rc != EOK) { 200 228 async_answer_0(icall_handle, EIO); 201 return; 202 } 203 204 async_answer_0(icall_handle, EOK); 229 goto error; 230 } 231 232 async_answer_0(icall_handle, EOK); 233 error: 234 vol_part_del_ref(part); 205 235 } 206 236 … … 251 281 errno_t rc; 252 282 283 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_srv()"); 284 253 285 sid = IPC_GET_ARG1(*icall); 254 286 fstype = IPC_GET_ARG2(*icall); … … 261 293 } 262 294 263 printf("vol_part_mkfs_srv: label=%p\n", label); 264 if (label != NULL) 265 printf("vol_part_mkfs_srv: label='%s'\n", label); 266 267 rc = vol_part_find_by_id(sid, &part); 295 if (label != NULL) { 296 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_srv: label='%s'", 297 label); 298 } 299 300 rc = vol_part_find_by_id_ref(sid, &part); 268 301 if (rc != EOK) { 269 302 free(label); … … 276 309 free(label); 277 310 async_answer_0(icall_handle, rc); 311 vol_part_del_ref(part); 278 312 return; 279 313 } … … 311 345 vol_part_info_srv(chandle, &call); 312 346 break; 347 case VOL_PART_EJECT: 348 vol_part_eject_srv(chandle, &call); 349 break; 313 350 case VOL_PART_EMPTY: 314 351 vol_part_empty_srv(chandle, &call);
Note:
See TracChangeset
for help on using the changeset viewer.