[components][dfs]格式化代码

This commit is contained in:
tangyuxin 2019-04-03 18:09:52 +08:00
parent 583f8c3073
commit e71ec65549
21 changed files with 248 additions and 238 deletions

View File

@ -203,7 +203,8 @@ int dfs_elm_mkfs(rt_device_t dev_id)
char logic_nbr[2] = {'0', ':'};
work = rt_malloc(_MAX_SS);
if(RT_NULL == work) {
if (RT_NULL == work)
{
return -ENOMEM;
}
@ -266,7 +267,8 @@ int dfs_elm_mkfs(rt_device_t dev_id)
/* [-] Working buffer */
/* [IN] Size of working buffer */
result = f_mkfs(logic_nbr, FM_ANY | FM_SFD, 0, work, _MAX_SS);
rt_free(work); work = RT_NULL;
rt_free(work);
work = RT_NULL;
/* check flag status, we need clear the temp driver stored in disk[] */
if (flag == FSM_STATUS_USE_TEMP_DRIVER)

View File

@ -577,7 +577,8 @@ int nfs_read(struct dfs_fd *file, void *buf, size_t count)
return 0;
args.file = fd->handle;
do {
do
{
args.offset = fd->offset;
args.count = count > DFS_NFS_MAX_MTU ? DFS_NFS_MAX_MTU : count;
count -= args.count;
@ -612,7 +613,8 @@ int nfs_read(struct dfs_fd *file, void *buf, size_t count)
}
}
xdr_free((xdrproc_t)xdr_READ3res, (char *)&res);
} while(count > 0);
}
while (count > 0);
xdr_free((xdrproc_t)xdr_READ3res, (char *)&res);
@ -642,7 +644,8 @@ int nfs_write(struct dfs_fd *file, const void *buf, size_t count)
args.file = fd->handle;
args.stable = FILE_SYNC;
do {
do
{
args.offset = fd->offset;
memset(&res, 0, sizeof(res));
@ -676,7 +679,8 @@ int nfs_write(struct dfs_fd *file, const void *buf, size_t count)
file->size = fd->size;
}
xdr_free((xdrproc_t)xdr_WRITE3res, (char *)&res);
} while (count > 0);
}
while (count > 0);
xdr_free((xdrproc_t)xdr_WRITE3res, (char *)&res);

View File

@ -543,7 +543,8 @@ void ls(const char *pathname)
rt_kprintf("BAD file: %s\n", dirent.d_name);
rt_free(fullpath);
}
}while(length > 0);
}
while (length > 0);
dfs_file_close(&fd);
}
@ -585,7 +586,8 @@ void cat(const char* filename)
{
rt_kprintf("%s", buffer);
}
}while (length > 0);
}
while (length > 0);
dfs_file_close(&fd);
}
@ -638,7 +640,8 @@ static void copyfile(const char *src, const char *dst)
break;
}
}
} while (read_bytes > 0);
}
while (read_bytes > 0);
dfs_file_close(&src_fd);
dfs_file_close(&fd);
@ -703,7 +706,8 @@ static void copydir(const char * src, const char * dst)
rt_free(src_entry_full);
rt_free(dst_entry_full);
}
}while(length > 0);
}
while (length > 0);
dfs_file_close(&cpfd);
}