Changeset 39330200 in mainline
- Timestamp:
- 2018-01-15T21:40:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba29018
- Parents:
- d8023313
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-15 21:20:07)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-15 21:40:49)
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
contrib/arch/uspace/srv/vfs/vfs.bp
rd8023313 r39330200 129 129 ?fstat { 130 130 tentative { 131 ?ipc_m_data_read /* struct stat */ {131 ?ipc_m_data_read /* vfs_stat_t */ { 132 132 alternative (fs; tmpfs; fat; devfs) { 133 133 [fnc.vfs_grab_phone] ; 134 134 !fs.stat { 135 !fs.ipc_m_data_read /* forward struct stat */135 !fs.ipc_m_data_read /* forward vfs_stat_t */ 136 136 } ; 137 137 [fnc.vfs_release_phone] … … 144 144 ?ipc_m_data_write /* path */ ; 145 145 tentative { 146 ?ipc_m_data_read /* struct stat */ {146 ?ipc_m_data_read /* vfs_stat_t */ { 147 147 alternative (fs; tmpfs; fat; devfs) { 148 148 [fnc.vfs_lookup_internal] ; 149 149 tentative { 150 150 !fs.stat { 151 !fs.ipc_m_data_read /* forward struct stat */151 !fs.ipc_m_data_read /* forward vfs_stat_t */ 152 152 } 153 153 } -
uspace/app/bdsh/cmds/modules/cat/cat.c
rd8023313 r39330200 215 215 216 216 if (tail != CAT_FULL_FILE) { 217 struct stat st;217 vfs_stat_t st; 218 218 219 219 if (vfs_stat(fd, &st) != EOK) { -
uspace/app/bdsh/cmds/modules/cp/cp.c
rd8023313 r39330200 80 80 static dentry_type_t get_type(const char *path) 81 81 { 82 struct stat s;82 vfs_stat_t s; 83 83 84 84 errno_t r = vfs_stat_path(path, &s); … … 340 340 */ 341 341 while ((dp = readdir(dir))) { 342 struct stat src_s;343 struct stat dest_s;342 vfs_stat_t src_s; 343 vfs_stat_t dest_s; 344 344 345 345 char src_dent[PATH_MAX]; … … 392 392 char *buff = NULL; 393 393 aoff64_t posr = 0, posw = 0; 394 struct stat st;394 vfs_stat_t st; 395 395 396 396 if (vb) -
uspace/app/bdsh/cmds/modules/ls/ls.h
rd8023313 r39330200 23 23 struct dir_elem_t { 24 24 char *name; 25 struct stat s;25 vfs_stat_t s; 26 26 }; 27 27 -
uspace/app/bdsh/cmds/modules/touch/touch.c
rd8023313 r39330200 82 82 int longind; 83 83 bool no_create = false; 84 struct stat file_stat;84 vfs_stat_t file_stat; 85 85 int fd = -1; 86 86 char *buff = NULL; -
uspace/app/bdsh/compl.c
rd8023313 r39330200 360 360 char *ent_path; 361 361 asprintf(&ent_path, "%s/%s", *cs->path, dent->d_name); 362 struct stat ent_stat;362 vfs_stat_t ent_stat; 363 363 if (vfs_stat_path(ent_path, &ent_stat) != EOK) { 364 364 /* Error */ -
uspace/app/df/df.c
rd8023313 r39330200 58 58 static errno_t size_to_human_readable(uint64_t, size_t, char **); 59 59 static void print_header(void); 60 static errno_t print_statfs( struct statfs*, char *, char *);60 static errno_t print_statfs(vfs_statfs_t *, char *, char *); 61 61 static void print_usage(void); 62 62 … … 64 64 { 65 65 int optres, errflg = 0; 66 struct statfsst;66 vfs_statfs_t st; 67 67 errno_t rc; 68 68 … … 147 147 } 148 148 149 static errno_t print_statfs( struct statfs*st, char *name, char *mountpoint)149 static errno_t print_statfs(vfs_statfs_t *st, char *name, char *mountpoint) 150 150 { 151 151 uint64_t const used_blocks = st->f_blocks - st->f_bfree; -
uspace/app/init/init.c
rd8023313 r39330200 152 152 static errno_t srv_startl(const char *path, ...) 153 153 { 154 struct stat s;154 vfs_stat_t s; 155 155 if (vfs_stat_path(path, &s) != EOK) { 156 156 printf("%s: Unable to stat %s\n", NAME, path); -
uspace/app/sysinst/futil.c
rd8023313 r39330200 108 108 DIR *dir; 109 109 struct dirent *de; 110 struct stat s;110 vfs_stat_t s; 111 111 char *srcp, *destp; 112 112 errno_t rc; … … 165 165 size_t fsize; 166 166 char *data; 167 struct stat st;167 vfs_stat_t st; 168 168 169 169 rc = vfs_lookup_open(srcp, WALK_REGULAR, MODE_READ, &sf); -
uspace/app/viewer/viewer.c
rd8023313 r39330200 115 115 return false; 116 116 117 struct stat stat;117 vfs_stat_t stat; 118 118 rc = vfs_stat(fd, &stat); 119 119 if (rc != EOK) { -
uspace/drv/bus/isa/isa.c
rd8023313 r39330200 279 279 errno_t rc; 280 280 size_t nread; 281 struct stat st;281 vfs_stat_t st; 282 282 283 283 rc = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ, &fd); -
uspace/lib/bithenge/src/failure.c
rd8023313 r39330200 225 225 } 226 226 227 errno_t bithenge_failure_fstat(int fd, struct stat *buf)227 errno_t bithenge_failure_fstat(int fd, vfs_stat_t *buf) 228 228 { 229 229 if (bithenge_should_fail()) { -
uspace/lib/bithenge/src/failure.h
rd8023313 r39330200 52 52 char *bithenge_failure_str_ndup(const char *, size_t); 53 53 errno_t bithenge_failure_open(const char *, int); 54 errno_t bithenge_failure_fstat(int, struct stat *);54 errno_t bithenge_failure_fstat(int, vfs_stat_t *); 55 55 56 56 #ifndef BITHENGE_FAILURE_DECLS_ONLY -
uspace/lib/bithenge/src/file.c
rd8023313 r39330200 102 102 assert(out); 103 103 104 struct stat stat;104 vfs_stat_t stat; 105 105 errno_t rc = vfs_stat(fd, &stat); 106 106 if (rc != EOK) { -
uspace/lib/c/generic/io/io.c
rd8023313 r39330200 814 814 stream->ungetc_chars = 0; 815 815 816 struct stat st;816 vfs_stat_t st; 817 817 switch (whence) { 818 818 case SEEK_SET: -
uspace/lib/c/generic/vfs/mtab.c
rd8023313 r39330200 42 42 #include <str.h> 43 43 44 static void process_mp(const char *path, struct stat *stat, list_t *mtab_list)44 static void process_mp(const char *path, vfs_stat_t *stat, list_t *mtab_list) 45 45 { 46 46 mtab_ent_t *ent; … … 54 54 ent->service_id = stat->service_id; 55 55 56 struct statfsstfs;56 vfs_statfs_t stfs; 57 57 if (vfs_statfs_path(path, &stfs) == EOK) 58 58 str_cpy(ent->fs_name, sizeof(ent->fs_name), stfs.fs_name); … … 75 75 while ((dirent = readdir(dir)) != NULL) { 76 76 char *child; 77 struct stat st;77 vfs_stat_t st; 78 78 errno_t rc; 79 79 int ret; … … 123 123 errno_t vfs_get_mtab_list(list_t *mtab_list) 124 124 { 125 struct stat st;125 vfs_stat_t st; 126 126 127 127 errno_t rc = vfs_stat_path("/", &st); -
uspace/lib/c/generic/vfs/vfs.c
rd8023313 r39330200 352 352 async_sess_t *vfs_fd_session(int file, iface_t iface) 353 353 { 354 struct stat stat;354 vfs_stat_t stat; 355 355 errno_t rc = vfs_stat(file, &stat); 356 356 if (rc != EOK) … … 1052 1052 * @return EOK on success or an error code 1053 1053 */ 1054 errno_t vfs_stat(int file, struct stat *stat)1054 errno_t vfs_stat(int file, vfs_stat_t *stat) 1055 1055 { 1056 1056 errno_t rc; … … 1060 1060 1061 1061 req = async_send_1(exch, VFS_IN_STAT, file, NULL); 1062 rc = async_data_read_start(exch, (void *) stat, sizeof( struct stat));1062 rc = async_data_read_start(exch, (void *) stat, sizeof(vfs_stat_t)); 1063 1063 if (rc != EOK) { 1064 1064 vfs_exchange_end(exch); … … 1086 1086 * @return EOK on success or an error code 1087 1087 */ 1088 errno_t vfs_stat_path(const char *path, struct stat *stat)1088 errno_t vfs_stat_path(const char *path, vfs_stat_t *stat) 1089 1089 { 1090 1090 int file; … … 1107 1107 * @return EOK on success or an error code 1108 1108 */ 1109 errno_t vfs_statfs(int file, struct statfs*st)1109 errno_t vfs_statfs(int file, vfs_statfs_t *st) 1110 1110 { 1111 1111 errno_t rc, ret; … … 1132 1132 * @return EOK on success or an error code 1133 1133 */ 1134 errno_t vfs_statfs_path(const char *path, struct statfs*st)1134 errno_t vfs_statfs_path(const char *path, vfs_statfs_t *st) 1135 1135 { 1136 1136 int file; -
uspace/lib/c/include/vfs/vfs.h
rd8023313 r39330200 57 57 58 58 59 struct stat {59 typedef struct { 60 60 fs_handle_t fs_handle; 61 61 service_id_t service_id; … … 66 66 aoff64_t size; 67 67 service_id_t service; 68 } ;68 } vfs_stat_t; 69 69 70 struct statfs { 70 typedef struct { 71 71 char fs_name[FS_NAME_MAXLEN + 1]; 72 72 uint32_t f_bsize; /* fundamental file system block size */ 73 73 uint64_t f_blocks; /* total data blocks in file system */ 74 74 uint64_t f_bfree; /* free blocks in fs */ 75 } ;75 } vfs_statfs_t; 76 76 77 77 /** List of file system types */ … … 111 111 extern int vfs_root(void); 112 112 extern errno_t vfs_root_set(int); 113 extern errno_t vfs_stat(int, struct stat *);114 extern errno_t vfs_stat_path(const char *, struct stat *);115 extern errno_t vfs_statfs(int, struct statfs*);116 extern errno_t vfs_statfs_path(const char *, struct statfs*);113 extern errno_t vfs_stat(int, vfs_stat_t *); 114 extern errno_t vfs_stat_path(const char *, vfs_stat_t *); 115 extern errno_t vfs_statfs(int, vfs_statfs_t *); 116 extern errno_t vfs_statfs_path(const char *, vfs_statfs_t *); 117 117 extern errno_t vfs_sync(int); 118 118 extern errno_t vfs_unlink(int, const char *, int); -
uspace/lib/fs/libfs.c
rd8023313 r39330200 733 733 size_t size; 734 734 if ((!async_data_read_receive(&callid, &size)) || 735 (size != sizeof( struct stat))) {735 (size != sizeof(vfs_stat_t))) { 736 736 ops->node_put(fn); 737 737 async_answer_0(callid, EINVAL); … … 740 740 } 741 741 742 struct stat stat;743 memset(&stat, 0, sizeof( struct stat));742 vfs_stat_t stat; 743 memset(&stat, 0, sizeof(vfs_stat_t)); 744 744 745 745 stat.fs_handle = fs_handle; … … 755 755 756 756 757 async_data_read_finalize(callid, &stat, sizeof( struct stat));757 async_data_read_finalize(callid, &stat, sizeof(vfs_stat_t)); 758 758 async_answer_0(rid, EOK); 759 759 } … … 772 772 size_t size; 773 773 if ((!async_data_read_receive(&callid, &size)) || 774 (size != sizeof( struct statfs))) {774 (size != sizeof(vfs_statfs_t))) { 775 775 goto error; 776 776 } 777 777 778 struct statfsst;779 memset(&st, 0, sizeof( struct statfs));778 vfs_statfs_t st; 779 memset(&st, 0, sizeof(vfs_statfs_t)); 780 780 781 781 str_cpy(st.fs_name, sizeof(st.fs_name), fs_name); … … 800 800 801 801 ops->node_put(fn); 802 async_data_read_finalize(callid, &st, sizeof( struct statfs));802 async_data_read_finalize(callid, &st, sizeof(vfs_statfs_t)); 803 803 async_answer_0(rid, EOK); 804 804 return; -
uspace/lib/posix/source/sys/stat.c
rd8023313 r39330200 52 52 * @return 0 on success, -1 on error. 53 53 */ 54 static int stat_to_posix(struct posix_stat *dest, struct stat *src)54 static int stat_to_posix(struct posix_stat *dest, vfs_stat_t *src) 55 55 { 56 56 memset(dest, 0, sizeof(struct posix_stat)); … … 88 88 int posix_fstat(int fd, struct posix_stat *st) 89 89 { 90 struct stat hst;90 vfs_stat_t hst; 91 91 if (failed(vfs_stat(fd, &hst))) 92 92 return -1; … … 116 116 int posix_stat(const char *restrict path, struct posix_stat *restrict st) 117 117 { 118 struct stat hst;118 vfs_stat_t hst; 119 119 if (failed(vfs_stat_path(path, &hst))) 120 120 return -1; -
uspace/lib/posix/source/unistd.c
rd8023313 r39330200 245 245 posix_off_t posix_lseek(int fildes, posix_off_t offset, int whence) 246 246 { 247 struct stat st;247 vfs_stat_t st; 248 248 249 249 switch (whence) { -
uspace/srv/devman/driver.c
rd8023313 r39330200 140 140 141 141 /* Check whether the driver's binary exists. */ 142 struct stat s;142 vfs_stat_t s; 143 143 if (vfs_stat_path(drv->binary_path, &s) != EOK) { 144 144 log_msg(LOG_DEFAULT, LVL_ERROR, "Driver not found at path `%s'.", -
uspace/srv/devman/match.c
rd8023313 r39330200 200 200 int fd; 201 201 size_t len = 0; 202 struct stat st;202 vfs_stat_t st; 203 203 204 204 errno_t rc = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ, &fd);
Note:
See TracChangeset
for help on using the changeset viewer.