Changeset 5930e3f in mainline for uspace/lib/fs/libfs.c
- Timestamp:
- 2013-07-09T06:06:37Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 951f32ce
- Parents:
- 11baebb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/fs/libfs.c
r11baebb r5930e3f 75 75 static void libfs_open_node(libfs_ops_t *, fs_handle_t, ipc_callid_t, 76 76 ipc_call_t *); 77 static void libfs_statfs(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); 77 78 78 79 static void vfs_out_mounted(ipc_callid_t rid, ipc_call_t *req) … … 219 220 async_answer_0(rid, rc); 220 221 } 221 #include<stdio.h> 222 222 223 static void vfs_out_statfs(ipc_callid_t rid, ipc_call_t *req) 223 { 224 printf("TRACE: vfs_out_statfs\n"); 225 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*req); 226 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*req); 227 228 fs_node_t *fn; 229 int rc = libfs_ops->node_get(&fn, service_id, index); 230 on_error(rc, answer_and_return(rid, rc)); 231 232 ipc_callid_t callid; 233 size_t size; 234 if ((!async_data_read_receive(&callid, &size)) || 235 (size != sizeof(struct stat))) { 236 libfs_ops->node_put(fn); 237 async_answer_0(callid, EINVAL); 238 async_answer_0(rid, EINVAL); 239 return; 240 } 241 242 struct statfs statfs; 243 memset(&statfs, 0, sizeof(struct statfs)); 244 245 statfs.f_bsize = libfs_ops->size_block(service_id); 246 247 libfs_ops->node_put(fn); 248 249 async_data_read_finalize(callid, &statfs, sizeof(struct statfs)); 250 async_answer_0(rid, EOK); 251 } 252 224 { 225 libfs_statfs(libfs_ops, reg.fs_handle, rid, req); 226 } 253 227 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg) 254 228 { … … 865 839 } 866 840 841 void libfs_statfs(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid, 842 ipc_call_t *request) 843 { 844 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 845 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 846 847 fs_node_t *fn; 848 int rc = ops->node_get(&fn, service_id, index); 849 on_error(rc, answer_and_return(rid, rc)); 850 851 ipc_callid_t callid; 852 size_t size; 853 if ((!async_data_read_receive(&callid, &size)) || 854 (size != sizeof(struct statfs))) { 855 ops->node_put(fn); 856 async_answer_0(callid, EINVAL); 857 async_answer_0(rid, EINVAL); 858 return; 859 } 860 861 struct statfs statfs; 862 memset(&statfs, 0, sizeof(struct statfs)); 863 864 if (NULL != ops->size_block) 865 statfs.f_bsize = ops->size_block(service_id); 866 867 ops->node_put(fn); 868 869 async_data_read_finalize(callid, &statfs, sizeof(struct statfs)); 870 async_answer_0(rid, EOK); 871 } 872 873 867 874 /** Open VFS triplet. 868 875 *
Note:
See TracChangeset
for help on using the changeset viewer.