diff options
| author | xqyjlj <[email protected]> | 2023-03-29 14:36:36 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2023-03-31 10:56:37 +0800 |
| commit | 7fb8f617561c2761d9e804ef4e83a881271a3d3c (patch) | |
| tree | c8d04ed5cd9cfa26ffd7abcd9de432773073194a /components | |
| parent | cd1e0a790124c216c5df3d3eb448e98f37f22097 (diff) | |
✨ feat(components/dfs/filesystems/devfs/devfs.c): add statfs support
Diffstat (limited to 'components')
| -rw-r--r-- | components/dfs/filesystems/devfs/devfs.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/components/dfs/filesystems/devfs/devfs.c b/components/dfs/filesystems/devfs/devfs.c index 7a54df3509..f0b7327ecd 100644 --- a/components/dfs/filesystems/devfs/devfs.c +++ b/components/dfs/filesystems/devfs/devfs.c @@ -29,6 +29,16 @@ int dfs_device_fs_mount(struct dfs_filesystem *fs, unsigned long rwflag, const v return RT_EOK; } +int dfs_device_fs_statfs(struct dfs_filesystem *fs, struct statfs *buf) +{ + buf->f_bsize = 512; + buf->f_blocks = 2048 * 64; // 64M + buf->f_bfree = buf->f_blocks; + buf->f_bavail = buf->f_bfree; + + return RT_EOK; +} + int dfs_device_fs_ioctl(struct dfs_fd *file, int cmd, void *args) { rt_err_t result; @@ -391,7 +401,7 @@ static const struct dfs_filesystem_ops _device_fs = dfs_device_fs_mount, RT_NULL, /*unmount*/ RT_NULL, /*mkfs*/ - RT_NULL, /*statfs*/ + dfs_device_fs_statfs, dfs_device_fs_unlink, dfs_device_fs_stat, RT_NULL, /*rename*/ |
