| 436 | } |
| 437 | |
| 438 | static int char_dev_fread(struct dfs_file *fd, void *buf, rt_size_t count) |
| 439 | { |
| 440 | int ret = 0; |
| 441 | struct fal_char_device *part = (struct fal_char_device *) fd->vnode->data; |
| 442 | |
| 443 | RT_ASSERT(part != RT_NULL); |
| 444 | |
| 445 | if (DFS_FILE_POS(fd) + count > part->fal_part->len) |
| 446 | count = part->fal_part->len - DFS_FILE_POS(fd); |
| 447 | |
| 448 | ret = fal_partition_read(part->fal_part, DFS_FILE_POS(fd), buf, count); |
| 449 | |
| 450 | if (ret != (int)(count)) |
| 451 | return 0; |
| 452 | |
| 453 | DFS_FILE_POS(fd) += ret; |
| 454 | |
| 455 | return ret; |
| 456 | } |
| 457 | |
| 458 | static int char_dev_fwrite(struct dfs_file *fd, const void *buf, rt_size_t count) |
| 459 | { |
nothing calls this directly
no test coverage detected