Changes in uspace/srv/volsrv/volsrv.c [9c2c7d2:2dab624] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/volsrv/volsrv.c
r9c2c7d2 r2dab624 46 46 #include <types/vol.h> 47 47 48 #include "mkfs.h"49 48 #include "part.h" 50 49 … … 66 65 return rc; 67 66 68 async_set_ fallback_port_handler(vol_client_conn, NULL);67 async_set_client_connection(vol_client_conn); 69 68 70 69 rc = loc_server_register(NAME); … … 132 131 async_answer_0(iid, EOK); 133 132 } 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 244 206 static void vol_part_mkfs_srv(ipc_callid_t iid, ipc_call_t *icall) 245 207 { … … 247 209 vol_part_t *part; 248 210 vol_fstype_t fstype; 249 char *label;250 211 int rc; 251 212 … … 253 214 fstype = IPC_GET_ARG2(*icall); 254 215 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 265 216 rc = vol_part_find_by_id(sid, &part); 266 217 if (rc != EOK) { 267 free(label);268 218 async_answer_0(iid, ENOENT); 269 219 return; 270 220 } 271 221 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); 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 280 231 async_answer_0(iid, EOK); 281 232 } … … 312 263 vol_part_empty_srv(callid, &call); 313 264 break; 314 case VOL_PART_LSUPP:315 vol_part_get_lsupp_srv(callid, &call);316 break;317 265 case VOL_PART_MKFS: 318 266 vol_part_mkfs_srv(callid, &call);
Note:
See TracChangeset
for help on using the changeset viewer.