Changeset 9c2c7d2 in mainline for uspace/lib/c
- Timestamp:
- 2017-07-06T15:52:15Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5cd1eb9a
- Parents:
- d858a660
- Location:
- uspace/lib/c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vol.c
rd858a660 r9c2c7d2 39 39 #include <loc.h> 40 40 #include <stdlib.h> 41 #include <str.h> 41 42 #include <vol.h> 42 43 … … 251 252 } 252 253 254 /** Get volume label support. */ 255 int vol_part_get_lsupp(vol_t *vol, vol_fstype_t fstype, 256 vol_label_supp_t *vlsupp) 257 { 258 async_exch_t *exch; 259 sysarg_t retval; 260 ipc_call_t answer; 261 262 exch = async_exchange_begin(vol->sess); 263 aid_t req = async_send_1(exch, VOL_PART_LSUPP, fstype, &answer); 264 int rc = async_data_read_start(exch, vlsupp, sizeof(vol_label_supp_t)); 265 async_exchange_end(exch); 266 267 if (rc != EOK) { 268 async_forget(req); 269 return EIO; 270 } 271 272 async_wait_for(req, &retval); 273 if (retval != EOK) 274 return EIO; 275 276 return EOK; 277 } 278 253 279 /** Create file system. */ 254 int vol_part_mkfs(vol_t *vol, service_id_t sid, vol_fstype_t fstype) 255 { 256 async_exch_t *exch; 257 int retval; 258 259 exch = async_exchange_begin(vol->sess); 260 retval = async_req_2_0(exch, VOL_PART_MKFS, sid, fstype); 261 async_exchange_end(exch); 280 int vol_part_mkfs(vol_t *vol, service_id_t sid, vol_fstype_t fstype, 281 const char *label) 282 { 283 async_exch_t *exch; 284 ipc_call_t answer; 285 sysarg_t retval; 286 287 exch = async_exchange_begin(vol->sess); 288 aid_t req = async_send_2(exch, VOL_PART_MKFS, sid, fstype, &answer); 289 retval = async_data_write_start(exch, label, str_size(label)); 290 async_exchange_end(exch); 291 292 if (retval != EOK) { 293 async_forget(req); 294 return retval; 295 } 296 297 async_wait_for(req, &retval); 262 298 263 299 if (retval != EOK) -
uspace/lib/c/include/ipc/vol.h
rd858a660 r9c2c7d2 43 43 VOL_PART_INFO, 44 44 VOL_PART_EMPTY, 45 VOL_PART_MKFS 45 VOL_PART_LSUPP, 46 VOL_PART_MKFS, 46 47 } vol_request_t; 47 48 -
uspace/lib/c/include/types/vol.h
rd858a660 r9c2c7d2 38 38 #include <async.h> 39 39 #include <ipc/vol.h> 40 #include <stdbool.h> 40 41 41 42 typedef enum { … … 76 77 } vol_part_info_t; 77 78 79 /** Volume label support */ 80 typedef struct { 81 /** Volume labels are supported */ 82 bool supported; 83 } vol_label_supp_t; 84 78 85 #endif 79 86 -
uspace/lib/c/include/vol.h
rd858a660 r9c2c7d2 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 extern int vol_part_get_lsupp(vol_t *, vol_fstype_t, vol_label_supp_t *); 51 extern int vol_part_mkfs(vol_t *, service_id_t, vol_fstype_t, const char *); 51 52 52 53 #endif
Note:
See TracChangeset
for help on using the changeset viewer.