Changeset d2c8533 in mainline for uspace/srv/vfs
- Timestamp:
- 2017-05-08T20:38:47Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f066a87
- Parents:
- 582a0b8
- Location:
- uspace/srv/vfs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/vfs/vfs.h
r582a0b8 rd2c8533 206 206 207 207 extern int vfs_op_clone(int oldfd, int newfd, bool desc); 208 extern int vfs_op_fsprobe(const char *, service_id_t, vfs_fs_probe_info_t *); 208 209 extern int vfs_op_mount(int mpfd, unsigned servid, unsigned flags, unsigned instance, const char *opts, const char *fsname, int *outfd); 209 210 extern int vfs_op_mtab_get(void); -
uspace/srv/vfs/vfs_ipc.c
r582a0b8 rd2c8533 45 45 } 46 46 47 static void vfs_in_fsprobe(ipc_callid_t rid, ipc_call_t *request) 48 { 49 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 50 char *fs_name = NULL; 51 ipc_callid_t callid; 52 vfs_fs_probe_info_t info; 53 size_t len; 54 int rc; 55 56 /* 57 * Now we expect the client to send us data with the name of the file 58 * system. 59 */ 60 rc = async_data_write_accept((void **) &fs_name, true, 0, 61 FS_NAME_MAXLEN, 0, NULL); 62 if (rc != EOK) { 63 async_answer_0(rid, rc); 64 return; 65 } 66 67 rc = vfs_op_fsprobe(fs_name, service_id, &info); 68 async_answer_0(rid, rc); 69 if (rc != EOK) 70 goto out; 71 72 /* Now we should get a read request */ 73 if (!async_data_read_receive(&callid, &len)) 74 goto out; 75 76 if (len > sizeof(info)) 77 len = sizeof(info); 78 (void) async_data_read_finalize(callid, &info, len); 79 80 out: 81 free(fs_name); 82 } 83 47 84 static void vfs_in_fstypes(ipc_callid_t rid, ipc_call_t *request) 48 85 { … … 297 334 vfs_in_clone(callid, &call); 298 335 break; 336 case VFS_IN_FSPROBE: 337 vfs_in_fsprobe(callid, &call); 338 break; 299 339 case VFS_IN_FSTYPES: 300 340 vfs_in_fstypes(callid, &call); -
uspace/srv/vfs/vfs_ops.c
r582a0b8 rd2c8533 190 190 } 191 191 192 int vfs_op_fsprobe(const char *fs_name, service_id_t sid, 193 vfs_fs_probe_info_t *info) 194 { 195 fs_handle_t fs_handle = 0; 196 sysarg_t rc; 197 int retval; 198 199 fibril_mutex_lock(&fs_list_lock); 200 fs_handle = fs_name_to_handle(0, fs_name, false); 201 fibril_mutex_unlock(&fs_list_lock); 202 203 if (fs_handle == 0) 204 return ENOFS; 205 206 /* Send probe request to the file system server */ 207 ipc_call_t answer; 208 async_exch_t *exch = vfs_exchange_grab(fs_handle); 209 aid_t msg = async_send_1(exch, VFS_OUT_FSPROBE, (sysarg_t) sid, 210 &answer); 211 if (msg == 0) 212 return EINVAL; 213 214 /* Read probe information */ 215 retval = async_data_read_start(exch, info, sizeof(*info)); 216 if (retval != EOK) { 217 async_forget(msg); 218 return retval; 219 } 220 221 async_wait_for(msg, &rc); 222 vfs_exchange_release(exch); 223 return rc; 224 } 225 192 226 int vfs_op_mount(int mpfd, unsigned service_id, unsigned flags, 193 227 unsigned instance, const char *opts, const char *fs_name, int *outfd)
Note:
See TracChangeset
for help on using the changeset viewer.