/* this function will read specified length data from a file descriptor to a buffer. */
ssize_t dfs_file_read(struct dfs_file *fd, void *buf, size_t len)
/* this function will read specified length data from a file descriptor to a buffer. */
ssize_t dfs_file_read(struct dfs_file *fd, void *buf, size_t len)
{
    int result = 0;
    if (fd == NULL)
    {
        return -EINVAL;
    }
    if (fd->vnode->fops->read == NULL)
    {
        return -ENOSYS;
    }
    if ((result = fd->vnode->fops->read(fd, buf, len)) < 0)
    {
        fd->flags |= DFS_F_EOF;
    }
    return result;
}