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