[nfs]:Format Optimize

This commit is contained in:
SummerGift 2017-12-15 17:15:13 +08:00
parent 4779429ab0
commit 4d0e205406
1 changed files with 9 additions and 9 deletions

View File

@ -579,7 +579,7 @@ int nfs_read(struct dfs_fd *file, void *buf, size_t count)
RT_ASSERT(file->data != NULL);
struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data));
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
fd = (nfs_file *)(nfs->data);
RT_ASSERT(fd != NULL);
@ -646,7 +646,7 @@ int nfs_write(struct dfs_fd *file, const void *buf, size_t count)
RT_ASSERT(file->data != NULL);
struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data));
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
fd = (nfs_file *)(nfs->data);
RT_ASSERT(fd != NULL);
@ -686,8 +686,8 @@ int nfs_write(struct dfs_fd *file, const void *buf, size_t count)
/* update current position */
file->pos = fd->offset;
/* update file size */
if (fd->size < fd->offset) fd->size = fd->offset;
file->size = fd->size;
if (fd->size < fd->offset) fd->size = fd->offset;
file->size = fd->size;
}
xdr_free((xdrproc_t)xdr_WRITE3res, (char *)&res);
} while (count > 0);
@ -707,7 +707,7 @@ int nfs_lseek(struct dfs_fd *file, off_t offset)
RT_ASSERT(file->data != NULL);
struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data));
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
fd = (nfs_file *)(nfs->data);
RT_ASSERT(fd != NULL);
@ -726,7 +726,7 @@ int nfs_close(struct dfs_fd *file)
nfs_filesystem *nfs;
RT_ASSERT(file->data != NULL);
struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data));
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
if (file->type == FT_DIRECTORY)
{
@ -756,7 +756,7 @@ int nfs_open(struct dfs_fd *file)
nfs_filesystem *nfs;
RT_ASSERT(file->data != NULL);
struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data));
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
if (file->flags & O_DIRECTORY)
@ -888,7 +888,7 @@ nfs_dir *nfs_opendir(nfs_filesystem *nfs, const char *path)
if (handle == NULL)
{
rt_free(dir);
return NULL;
}
@ -1099,7 +1099,7 @@ int nfs_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t count)
RT_ASSERT(file->data != NULL);
struct dfs_filesystem *dfs_nfs = ((struct dfs_filesystem*)(file->data));
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
nfs = (struct nfs_filesystem *)(dfs_nfs->data);
dir = (nfs_dir *)(nfs->data);
RT_ASSERT(dir != NULL);