From 4d0e205406c8c149e4de727df2e68b84f21d1e79 Mon Sep 17 00:00:00 2001 From: SummerGift Date: Fri, 15 Dec 2017 17:15:13 +0800 Subject: [PATCH] [nfs]:Format Optimize --- components/dfs/filesystems/nfs/dfs_nfs.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/dfs/filesystems/nfs/dfs_nfs.c b/components/dfs/filesystems/nfs/dfs_nfs.c index e7bccd9b2b..72ea80d48f 100644 --- a/components/dfs/filesystems/nfs/dfs_nfs.c +++ b/components/dfs/filesystems/nfs/dfs_nfs.c @@ -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);