!123 support querying mount infomations by cat /proc/mounts
Merge pull request !123 from JING/master
This commit is contained in:
commit
58f07f94a0
|
@ -35,6 +35,7 @@
|
|||
#include "fs/vfs_util.h"
|
||||
#include "fs/vnode.h"
|
||||
#include <sys/stat.h>
|
||||
#include <limits.h>
|
||||
|
||||
struct MountOps;
|
||||
|
||||
|
@ -50,6 +51,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 {
|
||||
|
|
|
@ -257,9 +257,23 @@ 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;
|
||||
}
|
||||
|
||||
int VfsProcfsClosedir(struct Vnode *vp, struct fs_dirent_s *dir)
|
||||
{
|
||||
return LOS_OK;
|
||||
}
|
||||
|
||||
const struct MountOps procfs_operations = {
|
||||
.Mount = VfsProcfsMount,
|
||||
.Unmount = NULL,
|
||||
.Statfs = VfsProcfsStatfs,
|
||||
};
|
||||
|
||||
static struct VnodeOps g_procfsVops = {
|
||||
|
@ -267,6 +281,7 @@ static struct VnodeOps g_procfsVops = {
|
|||
.Getattr = VfsProcfsStat,
|
||||
.Readdir = VfsProcfsReaddir,
|
||||
.Opendir = VfsProcfsOpendir,
|
||||
.Closedir = VfsProcfsClosedir
|
||||
};
|
||||
|
||||
static struct file_operations_vfs g_procfsFops = {
|
||||
|
|
Loading…
Reference in New Issue