Changes in uspace/srv/volsrv/volsrv.c [2dab624:9c2c7d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/volsrv/volsrv.c
r2dab624 r9c2c7d2 46 46 #include <types/vol.h> 47 47 48 #include "mkfs.h" 48 49 #include "part.h" 49 50 … … 65 66 return rc; 66 67 67 async_set_ client_connection(vol_client_conn);68 async_set_fallback_port_handler(vol_client_conn, NULL); 68 69 69 70 rc = loc_server_register(NAME); … … 131 132 async_answer_0(iid, EOK); 132 133 } 133 134 134 135 135 static void vol_part_info_srv(ipc_callid_t iid, ipc_call_t *icall) … … 204 204 } 205 205 206 static void vol_part_get_lsupp_srv(ipc_callid_t iid, ipc_call_t *icall) 207 { 208 vol_fstype_t fstype; 209 vol_label_supp_t vlsupp; 210 int rc; 211 212 fstype = IPC_GET_ARG1(*icall); 213 log_msg(LOG_DEFAULT, LVL_DEBUG, "vol_part_get_lsupp_srv(%u)", 214 fstype); 215 216 volsrv_part_get_lsupp(fstype, &vlsupp); 217 218 ipc_callid_t callid; 219 size_t size; 220 if (!async_data_read_receive(&callid, &size)) { 221 async_answer_0(callid, EREFUSED); 222 async_answer_0(iid, EREFUSED); 223 return; 224 } 225 226 if (size != sizeof(vol_label_supp_t)) { 227 async_answer_0(callid, EINVAL); 228 async_answer_0(iid, EINVAL); 229 return; 230 } 231 232 rc = async_data_read_finalize(callid, &vlsupp, 233 min(size, sizeof(vlsupp))); 234 if (rc != EOK) { 235 async_answer_0(callid, rc); 236 async_answer_0(iid, rc); 237 return; 238 } 239 240 async_answer_0(iid, EOK); 241 } 242 243 206 244 static void vol_part_mkfs_srv(ipc_callid_t iid, ipc_call_t *icall) 207 245 { … … 209 247 vol_part_t *part; 210 248 vol_fstype_t fstype; 249 char *label; 211 250 int rc; 212 251 … … 214 253 fstype = IPC_GET_ARG2(*icall); 215 254 255 rc = async_data_write_accept((void **)&label, true, 0, VOL_LABEL_MAXLEN, 256 0, NULL); 257 if (rc != EOK) { 258 async_answer_0(iid, rc); 259 return; 260 } 261 262 printf("vol_part_mkfs_srv: label=%p\n", label); 263 if (label!=NULL) printf("vol_part_mkfs_srv: label='%s'\n", label); 264 216 265 rc = vol_part_find_by_id(sid, &part); 217 266 if (rc != EOK) { 267 free(label); 218 268 async_answer_0(iid, ENOENT); 219 269 return; 220 270 } 221 271 222 rc = vol_part_mkfs_part(part, fstype); 223 if (rc != EOK) { 224 async_answer_0(iid, rc); 225 return; 226 } 227 228 part->pcnt = vpc_fs; 229 part->fstype = fstype; 230 272 rc = vol_part_mkfs_part(part, fstype, label); 273 if (rc != EOK) { 274 free(label); 275 async_answer_0(iid, rc); 276 return; 277 } 278 279 free(label); 231 280 async_answer_0(iid, EOK); 232 281 } … … 263 312 vol_part_empty_srv(callid, &call); 264 313 break; 314 case VOL_PART_LSUPP: 315 vol_part_get_lsupp_srv(callid, &call); 316 break; 265 317 case VOL_PART_MKFS: 266 318 vol_part_mkfs_srv(callid, &call);
Note:
See TracChangeset
for help on using the changeset viewer.