Commit Graph

36 Commits

Author SHA1 Message Date
zhushengle 1ef64e26a1 feat: 支持setns接口
BREAKING CHANGE:
支持setns接口对外变更:
1.新增setns接口

Close #I6D9Y0

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I9aacf9e5b8463e8e6c743a0041a5b2b18fdb0e12
2023-02-09 13:52:54 +08:00
zhushengle e2d903b663 feat: 支持mnt容器及增强能力
BREAKING CHANGE:
支持mnt容器及增强对外变更:
1.clone 支持CLONE_NEWNS
2.增加”/proc/[pid]/container/mnt" 用于查询容器信息
3.新增chroot接口

Close #I6APW2

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I5e8843a0f59bb5b0e6a66a6810dc552e8184a03e
2023-01-16 21:00:17 +08:00
zhangdengyu 8dbfd3846e fix: 修复告警
Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
2022-09-26 17:08:56 +08:00
zhangdengyu 043e84dfcb fix:修复函数返回错误等问题
Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
2022-09-25 10:09:29 +08:00
yinjiaming 2dc24da826 fix: 内核告警清理
【背景】
内核代码经代码扫描工具发现存在一些关于代码格式的告警,
现经修改解除掉告警.

【修改方案】
修改了代码中格式不规范的地方,修改的点有:
1.代码中一行过长
2.没有合理的添加空格和空行
3.没有按照规范进行缩进
4.括号的格式没有按照规范
5.注释的格式不对以及存在魔数字
6.函数的声明与定义的格式不一致
并更新了修改文件的版权头时间

【影响】
对现有的产品编译不会有影响。

re #I5H6F5

Signed-off-by: yinjiaming <yinjiaming@huawei.com>
Change-Id: Ie46b5b3238fd88c25f99542b8ccd138b956c6458
2022-08-08 13:09:54 +00:00
arvinzzz 47fac7158e fix: 内源检视问题修复
Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: I7c0b8f4026d8fbd4b0d985d4ce82187e56f1d6ec
2022-03-18 16:06:23 +08:00
wangchen 3824d1e9e4 【背景】内源代码检视问题
【修改方案】
1,按检视意见,进行资源泄露等问题的修改

【影响】
对现有的产品编译不会有影响。

re #I4WV56
Signed-off-by: wangchen <wangchen64@huawei.com>
2022-03-08 09:45:17 +00:00
Far c1c2be2a87 refactor: 文件系统Open性能优化
优化包括:
1. 提供VnodeLookupFullpath接口,如果路径是规范化的路径,则调用此接口可减少一次vfs_normalizepath接口的调用;
2. fatfs open钩子函数FIL和buffer同时malloc,减少一次malloc调用,同时去除不必要的数据写回;
3. 其他小细节的优化。

Close #I4E0CT

Signed-off-by: Far <yesiyuan2@huawei.com>
2021-10-15 11:59:38 +08:00
Leon Chan e4a06623ce fix: change the execFile field in TCB to execVnode
TEE需要借用TCB中的execFile来校验打开的文件,pagecache修改后,可执行程序在mmap之后,会被立即关闭,因此将execFile改为execVnode

close: #I4CLL9

Signed-off-by: Leon Chan <chenwei26@huawei.com>
2021-09-30 14:33:36 +08:00
Far 9ab3e351d3 fix: codex 清理
Close #I4BL3S

Signed-off-by: Far <yesiyuan2@huawei.com>
2021-09-27 14:43:28 +08:00
Leon Chan 38a6b804e9 feat: page cache backed by vnode instead of filep
1, change the owner of page to vnode
2, save the file path in vnode

close: #I44TBS
Signed-off-by: Leon Chan <chenwei26@huawei.com>
2021-09-14 15:31:33 +08:00
jason_gitee 98ca8441fe feat: add liteos patch ability
Signed-off-by: jason_gitee <yangjie140@huawei.com>
2021-08-28 08:02:50 +00:00
Guangyao Ma 27dca4d857 feat(vfs): vfs支持FD_CLOEXEC标记
首先,POSIX规范规定文件描述符需要支持close-on-exec属性,修改前的vfs不支持close-on-exec,当exec系列函数执行时,进程所有的文件将会被关闭(0,1,2也重新被打开)。但是,系统有些时候是不能在exec时关闭全部文件的,例如在执行exec之前,就需要重定向进程的某些文件描述符时(使用dup2),就希望该文件不被关闭,继续保持重定向属性,shell执行进程并重定向其标准输出到文件,这是我们经常做的事情。

BREAKING CHANGE:
执行exec类函数后,进程拥有的文件描述符情况发生变化:修改前,默认关闭所有的进程文件描述符,0,1,2重新打开;修改后,除非文件描述符拥有FD_CLOEXEC标记,否则该描述符不会被关闭。

re #I3U81W

Change-Id: I54e841ac88e9835ec23e97de0cbc906c4e11f5a4
Signed-off-by: Guangyao Ma <guangyao.ma@outlook.com>
2021-08-11 15:35:46 +08:00
wangchen 698756d1e6 fix: A核代码告警清零
【背景】定期A核代码告警清零。

【修改方案】
根据工具扫描结果,对代码告警进行更改。

【影响】
对现有的产品编译不会有影响。

re #I4378T
Signed-off-by: wangchen <253227059@qq.com>
2021-07-30 17:13:55 +08:00
mucor 3d1cf683f3 feat: add clear cache cmd to /proc/fs_cache
write "clear pathcahe" to clear pathcaches and vnodes
write "clear pagecache" to clear pagecaches
write "clear all" to clear both pathcaches and pagechaches
the cache in use will not be cleared

close: #I3XLPH

Signed-off-by: mucor <mucorwang@gmail.com>
2021-06-24 15:11:50 +08:00
mucor 231cb6be27 feat: add /proc/fs_cache to display cache info
add /proc/fs_cache to display vnode, path cache, page cache.
also change some bad virable name

close: #I3WWBD

Signed-off-by: mucor <mucorwang@gmail.com>
2021-06-22 14:53:17 +08:00
SimonLi 2f3d7efc24 回退 'Pull Request !342 : 增加/proc/fs_cache来显示文件系统缓存维测信息' 2021-06-21 21:33:52 +08:00
mucor 53c6d96c6f feat: add /proc/fs_cache to display cache info
add /proc/fs_cache to display vnode, path cache, page cache.
also change some bad virable name

close: #I3WESD

Signed-off-by: mucor <mucorwang@gmail.com>
2021-06-21 16:11:06 +08:00
mucor 73a777777e fix: remove redundant headfile
1.remove redundant headfile in kernel, such as:
  compiler.h;debug.h;automount.h;inode.h;syslog.h;net.h;
2.split fs.h to file.h and driver.h
3.move vnode.h and path_cache.h to vfs/include
4.remove redundant interface and defines

close: #I3RTNR

Signed-off-by: mucor <mucorwang@gmail.com>
2021-06-19 17:32:47 +08:00
chenwei 101a55d119 fix: codex
1,VFS代码中不修改参数增加const修饰
2,fs_file_mapping.c: 增加安全函数的判空
3,path_cache.c: sizeof改为使用类型
4,fs_syscall.c: 对NULL解引用
5,VnodeLookup:冗余的判空,及不正确的判空

close: I3UMWD
Signed-off-by: yansira <yansira@hotmail.com>
2021-06-07 22:45:40 +08:00
chenwei 4f514a16af fix: the total used vnode number not increased after unlink a file under
/dev/

fix #I3TS1Y
Signed-off-by: yansira <yansira@hotmail.com>
2021-06-04 16:49:04 +08:00
mucor 04bcb11c3c fix:add vnode destory for unregister dev node
Change-Id: I2205bbf42e7c2339f81443ace6924b12f4fa1c09
2021-04-30 15:31:03 +08:00
Far 5f6656cb36 fix: VnodeInUseIter and VnodeFreeAll used to be recursive
Function VnodeInUseIter and VnodeFreeAll used to be recursive.
Now we traverse the current in-use vnode list to find the vnode in
1 filesystem

Close #I3NN3U
2021-04-28 14:35:29 +08:00
openharmony_ci 89ed41a016 !173 [Desc] fix bug: kernel crashed after rmdir the umounted folder
Merge pull request !173 from LeonChan/lc-master
2021-04-21 19:31:12 +08:00
chenwei ac0d083b1c fix: kernel crashed after rmdir the umounted folder
Close: I3NGBT
Change-Id: I70130c42061e51f5978b48befea66a5925386343
2021-04-21 17:31:28 +08:00
openharmony_ci 5605063950 !163 [Desc] add debug code to fix bug: kernel crashed after rmdir the umounted folder 3
Merge pull request !163 from LeonChan/lc-master
2021-04-20 19:09:47 +08:00
chenwei c6e921241b fix: kernel crashed when delete a umounted folder
Close: I3MZZ6
Change-Id: Iab3919a2eebb44c82531a7fa7a2f688ec4bcc5a0
2021-04-20 16:10:24 +08:00
Far 902a11de9a fix: lookup new vnode may cause parent vnode freeing
Close #I3MYP4

Change-Id: I533f4bacaf7e6dd500f5ac3ce4f5343b3b885988
2021-04-20 11:43:14 +08:00
Caoruihong 7e73c929a2 remove __cplusplus guards in .c files
Change-Id: I052d930d54e63179b17b77f02c107a015f3cfc3f
2021-04-19 18:28:25 +08:00
openharmony_ci 75a85e4483 !151 [Desc] add debug code to fix bug: kernel crashed after rmdir the umounted folder, parentVnode->data null
Merge pull request !151 from LeonChan/lc-master
2021-04-19 11:00:57 +08:00
chenwei 296274b60f add debug code to fix bug: kernel crashed after rmdir the umounted folder, parent->data null
Change-Id: I44981eb9475feb4604ffe91244b4dff00f7d1548
2021-04-17 11:44:03 +08:00
openharmony_ci af2b0ac75b !144 用于检测umount栈溢出的调测功能
Merge pull request !144 from ysy4tc3/dev
2021-04-16 17:11:28 +08:00
chenwei a7c5abf64c add debug code to fix bug: kernel crashed after rmdir the umounted folder
Change-Id: Ia956fd09f1bd734cd26ab631359c1e2131fe1e37
2021-04-16 11:30:04 +08:00
Far 7e0e46828b Bugfix: add vnode iteration debug feature for a bug
buginfo: when try to umount a nfs node, it may casue stack overflow.

Change-Id: I7d96f74a770607c990ca5f51cb92fb2843a08d12
2021-04-16 11:00:38 +08:00
mucor 1884fa0523 fix readdir, rename
Change-Id: Ic443742e125915f0e5332a338dedea5c40348928
2021-03-24 18:15:06 +08:00
wangchenyang d970750808 Description:vfs refactoring
Feature or Bugfix:Feature
Binary Source:Huawei
PrivateCode(Yes/No):Yes

Change-Id: I175d2648bc6f9078c34de2c0a5c93fda10b86c47
ChangeID:13306388
2021-03-19 13:22:46 +08:00