Changeset d2c8533 in mainline for uspace/lib
- Timestamp:
- 2017-05-08T20:38:47Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f066a87
- Parents:
- 582a0b8
- Location:
- uspace/lib
- Files:
-
- 5 edited
-
c/generic/vfs/vfs.c (modified) (1 diff)
-
c/include/ipc/vfs.h (modified) (3 diffs)
-
c/include/vfs/vfs.h (modified) (1 diff)
-
fs/libfs.c (modified) (2 diffs)
-
fs/libfs.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/vfs/vfs.c
r582a0b8 rd2c8533 347 347 return loc_service_connect(stat.service, iface, 0); 348 348 } 349 350 /** Determine if a device contains the specified file system type. If so, 351 * return identification information. 352 * 353 * @param fs_name File system name 354 * @param serv Service representing the mountee 355 * @param info Place to store volume identification information 356 * 357 * @return EOK on success or a negative error code 358 */ 359 int vfs_fsprobe(const char *fs_name, service_id_t serv, 360 vfs_fs_probe_info_t *info) 361 { 362 sysarg_t rc; 363 364 ipc_call_t answer; 365 async_exch_t *exch = vfs_exchange_begin(); 366 aid_t req = async_send_1(exch, VFS_IN_FSPROBE, serv, &answer); 367 368 rc = async_data_write_start(exch, (void *) fs_name, 369 str_size(fs_name)); 370 371 async_wait_for(req, &rc); 372 373 if (rc != EOK) { 374 vfs_exchange_end(exch); 375 return rc; 376 } 377 378 rc = async_data_read_start(exch, info, sizeof(*info)); 379 vfs_exchange_end(exch); 380 381 return rc; 382 } 383 349 384 350 385 /** Return a list of currently available file system types -
uspace/lib/c/include/ipc/vfs.h
r582a0b8 rd2c8533 41 41 42 42 #define FS_NAME_MAXLEN 20 43 #define FS_LABEL_MAXLEN 256 44 #define FS_VUID_MAXLEN 128 43 45 #define MAX_PATH_LEN (32 * 1024) 44 46 #define MAX_MNTOPTS_LEN 256 … … 62 64 } vfs_info_t; 63 65 66 /** Data returned by filesystem probe regarding a specific volume. */ 67 typedef struct { 68 char label[FS_LABEL_MAXLEN + 1]; 69 char vuid[FS_VUID_MAXLEN + 1]; 70 } vfs_fs_probe_info_t; 71 64 72 typedef enum { 65 73 VFS_IN_CLONE = IPC_FIRST_USER_METHOD, 74 VFS_IN_FSPROBE, 66 75 VFS_IN_FSTYPES, 67 76 VFS_IN_MOUNT, … … 85 94 VFS_OUT_CLOSE = IPC_FIRST_USER_METHOD, 86 95 VFS_OUT_DESTROY, 96 VFS_OUT_FSPROBE, 87 97 VFS_OUT_IS_EMPTY, 88 98 VFS_OUT_LINK, -
uspace/lib/c/include/vfs/vfs.h
r582a0b8 rd2c8533 88 88 extern async_exch_t *vfs_exchange_begin(void); 89 89 extern void vfs_exchange_end(async_exch_t *); 90 extern int vfs_fsprobe(const char *, service_id_t, vfs_fs_probe_info_t *); 90 91 extern int vfs_fstypes(vfs_fstypes_t *); 91 92 extern void vfs_fstypes_free(vfs_fstypes_t *); -
uspace/lib/fs/libfs.c
r582a0b8 rd2c8533 81 81 ipc_call_t *); 82 82 83 static void vfs_out_fsprobe(ipc_callid_t rid, ipc_call_t *req) 84 { 85 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 86 int rc; 87 vfs_fs_probe_info_t info; 88 89 ipc_callid_t callid; 90 size_t size; 91 if ((!async_data_read_receive(&callid, &size)) || 92 (size != sizeof(info))) { 93 async_answer_0(callid, EIO); 94 async_answer_0(rid, EIO); 95 return; 96 } 97 98 memset(&info, 0, sizeof(info)); 99 rc = vfs_out_ops->fsprobe(service_id, &info); 100 if (rc != EOK) { 101 async_answer_0(callid, EIO); 102 async_answer_0(rid, rc); 103 return; 104 } 105 106 async_data_read_finalize(callid, &info, sizeof(info)); 107 async_answer_0(rid, EOK); 108 } 109 83 110 static void vfs_out_mounted(ipc_callid_t rid, ipc_call_t *req) 84 111 { … … 272 299 273 300 switch (IPC_GET_IMETHOD(call)) { 301 case VFS_OUT_FSPROBE: 302 vfs_out_fsprobe(callid, &call); 303 break; 274 304 case VFS_OUT_MOUNTED: 275 305 vfs_out_mounted(callid, &call); -
uspace/lib/fs/libfs.h
r582a0b8 rd2c8533 43 43 44 44 typedef struct { 45 int (* fsprobe)(service_id_t, vfs_fs_probe_info_t *); 45 46 int (* mounted)(service_id_t, const char *, fs_index_t *, aoff64_t *, 46 47 unsigned *);
Note:
See TracChangeset
for help on using the changeset viewer.
