| 481 | } |
| 482 | |
| 483 | int dfs_tmpfs_stat(struct dfs_filesystem *fs, |
| 484 | const char *path, |
| 485 | struct stat *st) |
| 486 | { |
| 487 | rt_size_t size; |
| 488 | struct tmpfs_file *d_file; |
| 489 | struct tmpfs_sb *superblock; |
| 490 | |
| 491 | superblock = (struct tmpfs_sb *)fs->data; |
| 492 | d_file = dfs_tmpfs_lookup(superblock, path, &size); |
| 493 | |
| 494 | if (d_file == NULL) |
| 495 | return -ENOENT; |
| 496 | |
| 497 | st->st_dev = (dev_t)dfs_filesystem_lookup(fs->path); |
| 498 | st->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH | |
| 499 | S_IWUSR | S_IWGRP | S_IWOTH; |
| 500 | if (d_file->type == TMPFS_TYPE_DIR) |
| 501 | { |
| 502 | st->st_mode &= ~S_IFREG; |
| 503 | st->st_mode |= S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH; |
| 504 | } |
| 505 | |
| 506 | st->st_size = d_file->size; |
| 507 | st->st_mtime = 0; |
| 508 | |
| 509 | return RT_EOK; |
| 510 | } |
| 511 | |
| 512 | int dfs_tmpfs_getdents(struct dfs_file *file, |
| 513 | struct dirent *dirp, |
nothing calls this directly
no test coverage detected