From c13366fd92b5f6a42f3e9811c6a83bea9bf7662e Mon Sep 17 00:00:00 2001 From: chenjing Date: Tue, 6 Apr 2021 15:21:29 +0800 Subject: [PATCH] /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 = {