Changeset f65d9cc in mainline for uspace/lib
- Timestamp:
- 2013-09-21T05:28:00Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 026271d5
- Parents:
- 772a172 (diff), b9f7848b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/lib
- Files:
-
- 2 added
- 8 edited
-
block/block.c (modified) (1 diff)
-
block/block.h (modified) (3 diffs)
-
c/generic/inetcfg.c (modified) (1 diff)
-
c/generic/vfs/vfs.c (modified) (1 diff)
-
c/include/inet/inet.h (modified) (1 diff)
-
c/include/inet/inetcfg.h (modified) (1 diff)
-
c/include/types/inet.h (added)
-
c/include/types/inetcfg.h (added)
-
ext4/libext4_filesystem.c (modified) (1 diff)
-
fs/libfs.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/block/block.c
r772a172 rf65d9cc 37 37 */ 38 38 39 #include "../../srv/vfs/vfs.h"40 39 #include <ipc/loc.h> 41 40 #include <ipc/services.h> -
uspace/lib/block/block.h
r772a172 rf65d9cc 29 29 */ 30 30 31 /** @addtogroup libblock 31 /** @addtogroup libblock 32 32 * @{ 33 */ 33 */ 34 34 /** 35 35 * @file … … 41 41 #include <stdint.h> 42 42 #include <async.h> 43 #include "../../srv/vfs/vfs.h"44 43 #include <fibril_synch.h> 45 44 #include <adt/hash_table.h> 46 45 #include <adt/list.h> 46 #include <loc.h> 47 47 48 48 /* … … 50 50 */ 51 51 52 /** 52 /** 53 53 * This macro is a symbolic value for situations where no special flags are 54 54 * needed. -
uspace/lib/c/generic/inetcfg.c
r772a172 rf65d9cc 279 279 aid_t req = async_send_1(exch, INETCFG_LINK_GET, link_id, &answer); 280 280 aid_t dreq = async_data_read(exch, name_buf, LOC_NAME_MAXLEN, &dreply); 281 int rc = async_data_read_start(exch, &linfo->mac_addr, sizeof(addr48_t)); 281 282 async_wait_for(dreq, &dretval); 282 283 283 284 async_exchange_end(exch); 284 285 285 if (dretval != EOK ) {286 if (dretval != EOK || rc != EOK) { 286 287 async_forget(req); 287 288 return dretval; -
uspace/lib/c/generic/vfs/vfs.c
r772a172 rf65d9cc 893 893 } 894 894 895 int statfs(const char *path, struct statfs *statfs) 896 { 897 sysarg_t rc; 898 sysarg_t rc_orig; 895 int statfs(const char *path, struct statfs *st) 896 { 897 sysarg_t rc, rc_orig; 899 898 aid_t req; 900 899 size_t pa_size; 901 900 902 901 char *pa = absolutize(path, &pa_size); 903 902 if (!pa) 904 903 return ENOMEM; 905 async_exch_t *exch = vfs_exchange_begin(); 906 904 905 async_exch_t *exch = vfs_exchange_begin(); 906 907 907 req = async_send_0(exch, VFS_IN_STATFS, NULL); 908 908 rc = async_data_write_start(exch, pa, pa_size); 909 if (rc != EOK) { 910 vfs_exchange_end(exch); 911 free(pa); 912 async_wait_for(req, &rc_orig); 913 if (rc_orig == EOK) 914 return (int) rc; 915 else 916 return (int) rc_orig; 917 } 918 rc = async_data_read_start(exch, (void *) statfs, sizeof(struct statfs)); 919 if (rc != EOK) { 920 vfs_exchange_end(exch); 921 free(pa); 922 async_wait_for(req, &rc_orig); 923 if (rc_orig == EOK) 924 return (int) rc; 925 else 926 return (int) rc_orig; 927 } 909 if (rc != EOK) 910 goto exit; 911 912 rc = async_data_read_start(exch, (void *) st, sizeof(*st)); 913 914 exit: 928 915 vfs_exchange_end(exch); 929 916 free(pa); 930 async_wait_for(req, &rc );931 return rc;917 async_wait_for(req, &rc_orig); 918 return (int) (rc_orig != EOK ? rc_orig : rc); 932 919 } 933 920 -
uspace/lib/c/include/inet/inet.h
r772a172 rf65d9cc 39 39 #include <ipc/loc.h> 40 40 #include <sys/types.h> 41 42 #define INET_TTL_MAX 255 43 44 typedef struct { 45 /** Local IP link service ID (optional) */ 46 service_id_t iplink; 47 inet_addr_t src; 48 inet_addr_t dest; 49 uint8_t tos; 50 void *data; 51 size_t size; 52 } inet_dgram_t; 53 54 typedef struct { 55 int (*recv)(inet_dgram_t *); 56 } inet_ev_ops_t; 57 58 typedef enum { 59 INET_DF = 1 60 } inet_df_t; 41 #include <types/inet.h> 61 42 62 43 extern int inet_init(uint8_t, inet_ev_ops_t *); -
uspace/lib/c/include/inet/inetcfg.h
r772a172 rf65d9cc 38 38 #include <inet/inet.h> 39 39 #include <sys/types.h> 40 41 /** Address object info */ 42 typedef struct { 43 /** Network address */ 44 inet_naddr_t naddr; 45 /** Link service ID */ 46 sysarg_t ilink; 47 /** Address object name */ 48 char *name; 49 } inet_addr_info_t; 50 51 /** IP link info */ 52 typedef struct { 53 /** Link service name */ 54 char *name; 55 /** Default MTU */ 56 size_t def_mtu; 57 } inet_link_info_t; 58 59 /** Static route info */ 60 typedef struct { 61 /** Destination network address */ 62 inet_naddr_t dest; 63 /** Router address */ 64 inet_addr_t router; 65 /** Static route name */ 66 char *name; 67 } inet_sroute_info_t; 40 #include <types/inetcfg.h> 68 41 69 42 extern int inetcfg_init(void); -
uspace/lib/ext4/libext4_filesystem.c
r772a172 rf65d9cc 39 39 #include <errno.h> 40 40 #include <malloc.h> 41 #include <ipc/vfs.h> 41 42 #include "libext4.h" 42 43 -
uspace/lib/fs/libfs.c
r772a172 rf65d9cc 806 806 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 807 807 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 808 808 809 809 fs_node_t *fn; 810 810 int rc = ops->node_get(&fn, service_id, index); 811 811 on_error(rc, answer_and_return(rid, rc)); 812 812 813 813 ipc_callid_t callid; 814 814 size_t size; … … 820 820 return; 821 821 } 822 822 823 823 struct stat stat; 824 824 memset(&stat, 0, sizeof(struct stat)); 825 825 826 826 stat.fs_handle = fs_handle; 827 827 stat.service_id = service_id; … … 832 832 stat.size = ops->size_get(fn); 833 833 stat.service = ops->service_get(fn); 834 834 835 835 ops->node_put(fn); 836 836 … … 845 845 service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request); 846 846 fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); 847 847 848 848 fs_node_t *fn; 849 849 int rc = ops->node_get(&fn, service_id, index); 850 850 on_error(rc, answer_and_return(rid, rc)); 851 851 852 852 ipc_callid_t callid; 853 853 size_t size; 854 854 if ((!async_data_read_receive(&callid, &size)) || 855 855 (size != sizeof(struct statfs))) { 856 ops->node_put(fn);857 async_answer_0(callid, EINVAL);858 async_answer_0(rid, EINVAL); 859 return;860 }861 862 struct statfs statfs;863 memset(&statfs, 0, sizeof(struct statfs));864 865 if (NULL != ops->size_block) {866 rc = ops->size_block(service_id, &statfs.f_bsize);867 if (rc != EOK) goto error; 868 }869 870 if (NULL != ops->total_block_count) {871 rc = ops->total_block_count(service_id, &statfs.f_blocks);872 if (rc != EOK) goto error;873 } 874 875 if (NULL != ops->free_block_count) {876 rc = ops->free_block_count(service_id, &statfs.f_bfree);877 if (rc != EOK)goto error;856 goto error; 857 } 858 859 struct statfs st; 860 memset(&st, 0, sizeof(struct statfs)); 861 862 if (ops->size_block != NULL) { 863 rc = ops->size_block(service_id, &st.f_bsize); 864 if (rc != EOK) 865 goto error; 866 } 867 868 if (ops->total_block_count != NULL) { 869 rc = ops->total_block_count(service_id, &st.f_blocks); 870 if (rc != EOK) 871 goto error; 872 } 873 874 if (ops->free_block_count != NULL) { 875 rc = ops->free_block_count(service_id, &st.f_bfree); 876 if (rc != EOK) 877 goto error; 878 878 } 879 879 880 880 ops->node_put(fn); 881 async_data_read_finalize(callid, &st atfs, sizeof(struct statfs));881 async_data_read_finalize(callid, &st, sizeof(struct statfs)); 882 882 async_answer_0(rid, EOK); 883 883 return;
Note:
See TracChangeset
for help on using the changeset viewer.
