Changeset 44fe800 in mainline
- Timestamp:
- 2015-10-17T21:50:38Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 68b5dd11
- Parents:
- ea0ff6b
- Location:
- uspace
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vol.c
rea0ff6b r44fe800 250 250 } 251 251 252 /** Create file system. */ 253 int vol_part_mkfs(vol_t *vol, service_id_t sid, vol_fstype_t fstype) 254 { 255 async_exch_t *exch; 256 int retval; 257 258 exch = async_exchange_begin(vol->sess); 259 retval = async_req_2_0(exch, VOL_PART_MKFS, sid, fstype); 260 async_exchange_end(exch); 261 262 if (retval != EOK) 263 return retval; 264 265 return EOK; 266 } 267 252 268 /** @} 253 269 */ -
uspace/lib/c/include/ipc/vol.h
rea0ff6b r44fe800 40 40 VOL_PART_ADD, 41 41 VOL_PART_INFO, 42 VOL_PART_EMPTY 42 VOL_PART_EMPTY, 43 VOL_PART_MKFS 43 44 } vol_request_t; 44 45 -
uspace/lib/c/include/types/vol.h
rea0ff6b r44fe800 35 35 #ifndef LIBC_TYPES_VOL_H_ 36 36 #define LIBC_TYPES_VOL_H_ 37 38 #include <async.h> 37 39 38 40 typedef enum { -
uspace/lib/c/include/vol.h
rea0ff6b r44fe800 48 48 extern int vol_part_info(vol_t *, service_id_t, vol_part_info_t *); 49 49 extern int vol_part_empty(vol_t *, service_id_t); 50 extern int vol_part_mkfs(vol_t *, service_id_t, vol_fstype_t); 50 51 51 52 #endif -
uspace/lib/fdisk/src/fdisk.c
rea0ff6b r44fe800 767 767 } 768 768 769 rc = vol_part_mkfs(dev->fdisk->vol, part->svc_id, pspec->fstype); 770 if (rc != EOK && rc != ENOTSUP) { 771 printf("mkfs failed\n"); 772 fdisk_part_remove(part); 773 (void) vbd_part_delete(dev->fdisk->vbd, partid); 774 return EIO; 775 } 776 769 777 printf("fdisk_part_create() - done\n"); 770 778 part->pcnt = vpc_fs; -
uspace/srv/bd/vbd/disk.c
rea0ff6b r44fe800 660 660 int rc; 661 661 662 log_msg(LOG_DEFAULT, LVL_NOTE, "vbds_part_create(%zu)", sid); 663 662 664 rc = vbds_disk_by_svcid(sid, &disk); 663 665 if (rc != EOK) { -
uspace/srv/volsrv/Makefile
rea0ff6b r44fe800 36 36 SOURCES = \ 37 37 empty.c \ 38 mkfs.c \ 38 39 part.c \ 39 40 volsrv.c -
uspace/srv/volsrv/empty.c
rea0ff6b r44fe800 85 85 } 86 86 87 int vol _part_is_empty(service_id_t sid, bool *rempty)87 int volsrv_part_is_empty(service_id_t sid, bool *rempty) 88 88 { 89 89 int rc; … … 176 176 } 177 177 178 int vol _part_empty(service_id_t sid)178 int volsrv_part_empty(service_id_t sid) 179 179 { 180 180 int rc; -
uspace/srv/volsrv/empty.h
rea0ff6b r44fe800 40 40 #include <loc.h> 41 41 42 extern int vol _part_is_empty(service_id_t, bool *);43 extern int vol _part_empty(service_id_t);42 extern int volsrv_part_is_empty(service_id_t, bool *); 43 extern int volsrv_part_empty(service_id_t); 44 44 45 45 #endif -
uspace/srv/volsrv/part.c
rea0ff6b r44fe800 44 44 45 45 #include "empty.h" 46 #include "mkfs.h" 46 47 #include "part.h" 47 48 #include "types/part.h" … … 154 155 155 156 log_msg(LOG_DEFAULT, LVL_NOTE, "Probe partition %s", part->svc_name); 156 rc = vol _part_is_empty(sid, &empty);157 rc = volsrv_part_is_empty(sid, &empty); 157 158 if (rc != EOK) { 158 159 log_msg(LOG_DEFAULT, LVL_ERROR, "Failed determining if " … … 256 257 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_empty_part()"); 257 258 258 rc = vol _part_empty(part->svc_id);259 rc = volsrv_part_empty(part->svc_id); 259 260 if (rc != EOK) { 260 261 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_empty_part() - failed %d", … … 268 269 } 269 270 271 int vol_part_mkfs_part(vol_part_t *part, vol_fstype_t fstype) 272 { 273 int rc; 274 275 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_part()"); 276 277 rc = volsrv_part_mkfs(part->svc_id, fstype); 278 if (rc != EOK) { 279 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_part() - failed %d", 280 rc); 281 return rc; 282 } 283 284 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_part() - success"); 285 part->pcnt = vpc_fs; 286 part->fstype = fstype; 287 return EOK; 288 } 289 270 290 int vol_part_get_info(vol_part_t *part, vol_part_info_t *pinfo) 271 291 { -
uspace/srv/volsrv/part.h
rea0ff6b r44fe800 49 49 extern int vol_part_find_by_id(service_id_t, vol_part_t **); 50 50 extern int vol_part_empty_part(vol_part_t *); 51 extern int vol_part_mkfs_part(vol_part_t *, vol_fstype_t); 51 52 extern int vol_part_get_info(vol_part_t *, vol_part_info_t *); 52 53 -
uspace/srv/volsrv/volsrv.c
rea0ff6b r44fe800 220 220 } 221 221 222 static void vol_part_mkfs_srv(ipc_callid_t iid, ipc_call_t *icall) 223 { 224 service_id_t sid; 225 vol_part_t *part; 226 vol_fstype_t fstype; 227 int rc; 228 229 sid = IPC_GET_ARG1(*icall); 230 fstype = IPC_GET_ARG2(*icall); 231 232 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_srv(%zu, %d)", sid, 233 fstype); 234 235 rc = vol_part_find_by_id(sid, &part); 236 if (rc != EOK) { 237 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_srv(%zu) - " 238 "partition not found", sid); 239 async_answer_0(iid, ENOENT); 240 return; 241 } 242 243 log_msg(LOG_DEFAULT, LVL_NOTE, "vol_part_mkfs_srv(%zu) - " 244 "call vol_part_mkfs_part()", sid); 245 rc = vol_part_mkfs_part(part, fstype); 246 if (rc != EOK) { 247 async_answer_0(iid, rc); 248 return; 249 } 250 251 async_answer_0(iid, EOK); 252 } 253 222 254 static void vol_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg) 223 255 { … … 251 283 vol_part_empty_srv(callid, &call); 252 284 break; 285 case VOL_PART_MKFS: 286 vol_part_mkfs_srv(callid, &call); 287 break; 253 288 default: 254 289 async_answer_0(callid, EINVAL);
Note:
See TracChangeset
for help on using the changeset viewer.