From c13366fd92b5f6a42f3e9811c6a83bea9bf7662e Mon Sep 17 00:00:00 2001 From: chenjing Date: Tue, 6 Apr 2021 15:21:29 +0800 Subject: [PATCH 1/4] /proc/mounts --- fs/include/fs/mount.h | 1 + fs/proc/os_adapt/proc_vfs.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/fs/include/fs/mount.h b/fs/include/fs/mount.h index c2a3a46d..7ace648c 100644 --- a/fs/include/fs/mount.h +++ b/fs/include/fs/mount.h @@ -50,6 +50,7 @@ struct Mount { void *data; /* private data */ uint32_t hashseed; /* Random seed for vfshash */ unsigned long mountFlags; /* Flags for mount */ + char pathName[PATH_MAX]; /* path name of mount point */ }; struct MountOps { diff --git a/fs/proc/os_adapt/proc_vfs.c b/fs/proc/os_adapt/proc_vfs.c index 87412b11..21560ece 100755 --- a/fs/proc/os_adapt/proc_vfs.c +++ b/fs/proc/os_adapt/proc_vfs.c @@ -257,9 +257,18 @@ int VfsProcfsClose(struct file *filep) return result; } +int VfsProcfsStatfs(struct Mount *mnt, struct statfs *buf) +{ + (void)memset_s(buf, sizeof(struct statfs), 0, sizeof(struct statfs)); + buf->f_type = PROCFS_MAGIC; + + return LOS_OK; +} + const struct MountOps procfs_operations = { .Mount = VfsProcfsMount, .Unmount = NULL, + .Statfs = VfsProcStatfs, }; static struct VnodeOps g_procfsVops = { From 7c3c92f87a47a9d95a6d40ffa0d9b1514d00dadf Mon Sep 17 00:00:00 2001 From: chenjing Date: Tue, 6 Apr 2021 16:20:58 +0800 Subject: [PATCH 2/4] /proc/mounts --- fs/include/fs/mount.h | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/include/fs/mount.h b/fs/include/fs/mount.h index 7ace648c..cd524cda 100644 --- a/fs/include/fs/mount.h +++ b/fs/include/fs/mount.h @@ -35,6 +35,7 @@ #include "fs/vfs_util.h" #include "fs/vnode.h" #include +#include struct MountOps; From 18d5e253731e1ea32e030639a816cb346ededa40 Mon Sep 17 00:00:00 2001 From: chenjing Date: Tue, 6 Apr 2021 17:33:49 +0800 Subject: [PATCH 3/4] /proc/mounts --- fs/proc/os_adapt/proc_vfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/os_adapt/proc_vfs.c b/fs/proc/os_adapt/proc_vfs.c index 21560ece..2ab252fd 100755 --- a/fs/proc/os_adapt/proc_vfs.c +++ b/fs/proc/os_adapt/proc_vfs.c @@ -268,7 +268,7 @@ int VfsProcfsStatfs(struct Mount *mnt, struct statfs *buf) const struct MountOps procfs_operations = { .Mount = VfsProcfsMount, .Unmount = NULL, - .Statfs = VfsProcStatfs, + .Statfs = VfsProcfsStatfs, }; static struct VnodeOps g_procfsVops = { From 62c039b287c532ee05c7be266910b7d9e3a97aa0 Mon Sep 17 00:00:00 2001 From: chenjing Date: Wed, 7 Apr 2021 09:49:17 +0800 Subject: [PATCH 4/4] proc closedir --- fs/proc/os_adapt/proc_vfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/proc/os_adapt/proc_vfs.c b/fs/proc/os_adapt/proc_vfs.c index 2ab252fd..2d06f478 100755 --- a/fs/proc/os_adapt/proc_vfs.c +++ b/fs/proc/os_adapt/proc_vfs.c @@ -265,6 +265,11 @@ int VfsProcfsStatfs(struct Mount *mnt, struct statfs *buf) return LOS_OK; } +int VfsProcfsClosedir(struct Vnode *vp, struct fs_dirent_s *dir) +{ + return LOS_OK; +} + const struct MountOps procfs_operations = { .Mount = VfsProcfsMount, .Unmount = NULL, @@ -276,6 +281,7 @@ static struct VnodeOps g_procfsVops = { .Getattr = VfsProcfsStat, .Readdir = VfsProcfsReaddir, .Opendir = VfsProcfsOpendir, + .Closedir = VfsProcfsClosedir }; static struct file_operations_vfs g_procfsFops = {