mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/vfs: Drop per-filesystem fstatvfs
No current file system implements it, there is no defined semantic difference between running fstatfs and the fallback currently implemented, and there is practically no optimization gained from not just running it through a single statvfs.
This commit is contained in:
parent
4c54bd8bdb
commit
ff1f81aac8
@ -660,23 +660,6 @@ struct vfs_file_system_ops {
|
||||
* @return <0 on error
|
||||
*/
|
||||
int (*statvfs) (vfs_mount_t *mountp, const char *restrict path, struct statvfs *restrict buf);
|
||||
|
||||
/**
|
||||
* @brief Get file system status of an open file
|
||||
*
|
||||
* @p path is only passed for consistency against the POSIX statvfs function.
|
||||
* @c vfs_statvfs calls this function only when it has determined that
|
||||
* @p path belongs to this file system. @p path is a file system relative
|
||||
* path and does not necessarily name an existing file.
|
||||
*
|
||||
* @param[in] mountp file system mount to operate on
|
||||
* @param[in] filp pointer to an open file on the file system being queried
|
||||
* @param[out] buf pointer to statvfs struct to fill
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return <0 on error
|
||||
*/
|
||||
int (*fstatvfs) (vfs_mount_t *mountp, vfs_file_t *filp, struct statvfs *buf);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -216,15 +216,11 @@ int vfs_fstatvfs(int fd, struct statvfs *buf)
|
||||
}
|
||||
vfs_file_t *filp = &_vfs_open_files[fd];
|
||||
memset(buf, 0, sizeof(*buf));
|
||||
if (filp->mp->fs->fs_op->fstatvfs == NULL) {
|
||||
/* file system driver does not implement fstatvfs() */
|
||||
if (filp->mp->fs->fs_op->statvfs != NULL) {
|
||||
/* Fall back to statvfs */
|
||||
return filp->mp->fs->fs_op->statvfs(filp->mp, "/", buf);
|
||||
}
|
||||
if (filp->mp->fs->fs_op->statvfs == NULL) {
|
||||
/* file system driver does not implement statvfs() */
|
||||
return -EINVAL;
|
||||
}
|
||||
return filp->mp->fs->fs_op->fstatvfs(filp->mp, filp, buf);
|
||||
return filp->mp->fs->fs_op->statvfs(filp->mp, "/", buf);
|
||||
}
|
||||
|
||||
off_t vfs_lseek(int fd, off_t off, int whence)
|
||||
|
Loading…
Reference in New Issue
Block a user