提交 78c24f08 编写于 作者: Y YOUR_NAME

IssueNo:#I3EOI0

Description:Delete VM to support only kernel mode.
Sig:liteos_a
Feature or Bugfix:Feature
Binary Source:No

Change-Id: Ie1029c8fbc0c1b85c138663933118d2d148b7769
上级 58fc3387
......@@ -227,7 +227,9 @@ int block_proxy(FAR const char *blkdev, int oflags)
VnodeDrop();
/* Block char device is no need for file mapping */
#ifdef LOSCFG_KERNEL_VM
(void)remove_mapping(chardev);
#endif
/* Free the allocate character driver name and return the open file
* descriptor.
......
......@@ -507,7 +507,6 @@ int files_allocate(struct Vnode *vnode_ptr, int oflags, off_t pos, void *priv, i
static int files_close_internal(int fd, LosProcessCB *processCB)
{
int ret = OK;
struct file *filep = NULL;
struct filelist *list = NULL;
struct files_struct *process_files = NULL;
......@@ -544,15 +543,18 @@ static int files_close_internal(int fd, LosProcessCB *processCB)
/* The filep->f_refcount may not be zero here, when the filep is shared in parent-child processes.
so, upon closing the filep in current process, relevant region must be released immediately */
filep = &list->fl_files[fd];
#ifdef LOSCFG_KERNEL_VM
struct file *filep = &list->fl_files[fd];
OsVmmFileRegionFree(filep, processCB);
#endif
list->fl_files[fd].f_refcount--;
if (list->fl_files[fd].f_refcount == 0)
{
#ifdef LOSCFG_KERNEL_VM
dec_mapping_nolock(filep->f_mapping);
#endif
ret = _files_close(&list->fl_files[fd]);
if (ret == OK)
{
......
......@@ -303,7 +303,9 @@ int fp_open(char *fullpath, int oflags, mode_t mode)
/* we do not bother to handle the NULL scenario, if so, page-cache feature will not be used
* when we do the file fault */
#ifdef LOSCFG_KERNEL_VM
add_mapping(filep, fullpath);
#endif
return fd;
......
......@@ -140,7 +140,9 @@ int do_unlink(int dirfd, const char *pathname)
VnodeFree(vnode);
VnodeDrop();
#ifdef LOSCFG_KERNEL_VM
(void)remove_mapping(fullpath);
#endif
/* Successfully unlinked */
free(fullpath);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册