/* this function will fetch directory entries from a directory descriptor. */
int dfs_file_getdents(struct dfs_fd *fd, struct dirent *dirp, size_t nbytes)
/* this function will fetch directory entries from a directory descriptor. */
int dfs_file_getdents(struct dfs_fd *fd, struct dirent *dirp, size_t nbytes)
{
    if (fd == NULL || fd->type != FT_DIRECTORY)
        return -EINVAL;
    if (fd->fops->getdents != NULL)
        return fd->fops->getdents(fd, dirp, nbytes);
    return -ENOSYS;
}