提交 42566ca1 编写于 作者: M mamingshuai

update openharmony 1.0.1

上级 7237da08
文件模式从 100755 更改为 100644
[
{
"Name" : "rt-thread",
"License" : "Apache License V2.0",
"License File" : "COPYRIGHT",
"Version Number" : "4.0.2",
"Owner" : "tonghaoyang1@huawei.com",
"Upstream URL" : "http://code.google.com/p/rt-thread/",
"Description" : "The Real-Time Thread(RT-Thread) Operating System is an open source real-time operating system developed by the RT-Thread Studio based in China, more on kernel and components Introduction."
}
]
文件模式从 100755 更改为 100644
文件模式从 100755 更改为 100644
文件模式从 100755 更改为 100644
文件模式从 100755 更改为 100644
#ifndef JFFS2_CONFIG_H #ifndef JFFS2_CONFIG_H
#define JFFS2_CONFIG_H #define JFFS2_CONFIG_H
#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
#include "spinor.h"
#endif
#include "mtd_partition.h" #include "mtd_partition.h"
#ifdef __cplusplus #ifdef __cplusplus
......
文件模式从 100755 更改为 100644
文件模式从 100755 更改为 100644
文件模式从 100755 更改为 100644
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
#include "jffs2/compr.h" #include "jffs2/compr.h"
#include "port/fcntl.h" #include "port/fcntl.h"
#include "porting.h" #include "porting.h"
#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
#include "spinor.h"
#endif
#include "limits.h" #include "limits.h"
#include "los_process_pri.h" #include "los_process_pri.h"
#include "capability_type.h" #include "capability_type.h"
...@@ -166,7 +163,7 @@ static int find_entry(jffs2_dirsearch * ds) ...@@ -166,7 +163,7 @@ static int find_entry(jffs2_dirsearch * ds)
struct _inode *dir = ds->dir; struct _inode *dir = ds->dir;
const unsigned char *name = ds->path; const unsigned char *name = ds->path;
const unsigned char *n = name; const unsigned char *n = name;
char namelen = 0; int namelen = 0;
struct _inode *d; struct _inode *d;
int accMode = 0; int accMode = 0;
...@@ -1418,7 +1415,6 @@ static int jffs2_fo_dirread(struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio) ...@@ -1418,7 +1415,6 @@ static int jffs2_fo_dirread(struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio)
out_sem: out_sem:
mutex_unlock(&f->sem); mutex_unlock(&f->sem);
if (fd == NULL) { if (fd == NULL) {
fp->f_offset = 2;
D2(printk D2(printk
(KERN_DEBUG "reached the end of the directory\n")); (KERN_DEBUG "reached the end of the directory\n"));
return ENOENT; return ENOENT;
......
...@@ -24,9 +24,6 @@ ...@@ -24,9 +24,6 @@
#include "errno.h" #include "errno.h"
#include "jffs2_fs_i.h" #include "jffs2_fs_i.h"
#include "jffs2_fs_sb.h" #include "jffs2_fs_sb.h"
#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
#include "spinor.h"
#endif
#include "fileio.h" #include "fileio.h"
#include "sys/uio.h" #include "sys/uio.h"
......
...@@ -293,19 +293,19 @@ static loff_t vfs_jffs_seek64(FAR struct file *filep, loff_t offset, int whence) ...@@ -293,19 +293,19 @@ static loff_t vfs_jffs_seek64(FAR struct file *filep, loff_t offset, int whence)
static int vfs_jffs_ioctl(FAR struct file *filep, int cmd, unsigned long arg) static int vfs_jffs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{ {
PRINT_ERR("%s NOT SUPPORT\n", __FUNCTION__); PRINT_DEBUG("%s NOT SUPPORT\n", __FUNCTION__);
return -ENOSYS; return -ENOSYS;
} }
static int vfs_jffs_sync(FAR struct file *filep) static int vfs_jffs_sync(FAR struct file *filep)
{ {
PRINT_ERR("%s NOT SUPPORT\n", __FUNCTION__); PRINT_DEBUG("%s NOT SUPPORT\n", __FUNCTION__);
return -ENOSYS; return -ENOSYS;
} }
static int vfs_jffs_dup(FAR const struct file *oldp, FAR struct file *newp) static int vfs_jffs_dup(FAR const struct file *oldp, FAR struct file *newp)
{ {
PRINT_ERR("%s NOT SUPPORT\n", __FUNCTION__); PRINT_DEBUG("%s NOT SUPPORT\n", __FUNCTION__);
return -ENOSYS; return -ENOSYS;
} }
...@@ -363,45 +363,49 @@ static int vfs_jffs_closedir(FAR struct inode *mountpt, FAR struct fs_dirent_s * ...@@ -363,45 +363,49 @@ static int vfs_jffs_closedir(FAR struct inode *mountpt, FAR struct fs_dirent_s *
static int vfs_jffs_readdir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir) static int vfs_jffs_readdir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir)
{ {
/* reduced value between dir->fd_dir.d_off and jffs2_file->f_offset */
#define REDUCED_VALUE 3
cyg_file *jffs2_file = NULL; cyg_file *jffs2_file = NULL;
struct CYG_UIO_TAG uio_s; struct CYG_UIO_TAG uio_s;
struct CYG_IOVEC_TAG iovec; struct CYG_IOVEC_TAG iovec;
struct jffs2_dirent jffs2_d; struct jffs2_dirent jffs2_d;
int result; int result;
int i = 0;
uint32_t dst_name_size; uint32_t dst_name_size;
jffs2_file = (cyg_file *)(dir->u.fs_dir); jffs2_file = (cyg_file *)(dir->u.fs_dir);
/* set jffs2_d */ while (i < MAX_DIRENT_NUM && i < dir->read_cnt) {
(void)memset_s(&jffs2_d, sizeof(struct jffs2_dirent), 0, sizeof(struct jffs2_dirent)); /* set jffs2_d */
/* set CYG_UIO_TAG uio_s */ (void)memset_s(&jffs2_d, sizeof(struct jffs2_dirent), 0, sizeof(struct jffs2_dirent));
uio_s.uio_iov = &iovec; /* set CYG_UIO_TAG uio_s */
uio_s.uio_iov->iov_base = &jffs2_d; uio_s.uio_iov = &iovec;
uio_s.uio_iov->iov_len = sizeof(struct jffs2_dirent);; uio_s.uio_iov->iov_base = &jffs2_d;
uio_s.uio_iovcnt = 1; /* must be 1 */ uio_s.uio_iov->iov_len = sizeof(struct jffs2_dirent);;
uio_s.uio_offset = 0; /* not used... */ uio_s.uio_iovcnt = 1; /* must be 1 */
uio_s.uio_resid = uio_s.uio_iov->iov_len; /* seem no use in jffs2; */ uio_s.uio_offset = 0; /* not used... */
uio_s.uio_resid = uio_s.uio_iov->iov_len; /* seem no use in jffs2; */
jffs_mutex_take(&jffs2_lock, (uint32_t)JFFS_WAITING_FOREVER);
result = jffs2_dir_operations.readdir(jffs2_file, &uio_s); jffs_mutex_take(&jffs2_lock, (uint32_t)JFFS_WAITING_FOREVER);
jffs_mutex_release(&jffs2_lock); result = jffs2_dir_operations.readdir(jffs2_file, &uio_s);
jffs_mutex_release(&jffs2_lock);
if (result)
return jffs2_result_to_vfs(result);
dir->fd_dir.d_off = jffs2_file->f_offset - REDUCED_VALUE; if (result) {
dir->fd_dir.d_type = jffs2_d.d_type; break;
dir->fd_dir.d_reclen = (uint16_t)sizeof(struct dirent); }
dst_name_size = sizeof(dir->fd_dir.d_name);
result = strncpy_s(dir->fd_dir.d_name, dst_name_size, jffs2_d.d_name, dst_name_size - 1); dir->fd_dir[i].d_type = jffs2_d.d_type;
if (result != EOK) { dst_name_size = sizeof(dir->fd_dir[i].d_name);
return -ENAMETOOLONG; result = strncpy_s(dir->fd_dir[i].d_name, dst_name_size, jffs2_d.d_name, dst_name_size - 1);
if (result != EOK) {
return -ENAMETOOLONG;
}
dir->fd_dir[i].d_name[dst_name_size - 1] = '\0';
dir->fd_position++;
dir->fd_dir[i].d_off = dir->fd_position;
dir->fd_dir[i].d_reclen = (uint16_t)sizeof(struct dirent);
i++;
} }
dir->fd_dir.d_name[dst_name_size - 1] = '\0'; return i;
return OK;
} }
static int vfs_jffs_rewinddir(FAR struct inode *mountpt, static int vfs_jffs_rewinddir(FAR struct inode *mountpt,
...@@ -620,6 +624,7 @@ static int vfs_jffs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf) ...@@ -620,6 +624,7 @@ static int vfs_jffs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf)
buf->f_frsize = BLOCK_SIZE; buf->f_frsize = BLOCK_SIZE;
buf->f_files = 0; buf->f_files = 0;
buf->f_ffree = 0; buf->f_ffree = 0;
buf->f_flags = mountpt->mountflags;
return 0; return 0;
} }
......
文件模式从 100755 更改为 100644
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册