rtt更新
This commit is contained in:
@@ -20,6 +20,38 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#define MS_RDONLY 1
|
||||
#define MS_NOSUID 2
|
||||
#define MS_NODEV 4
|
||||
#define MS_NOEXEC 8
|
||||
#define MS_SYNCHRONOUS 16
|
||||
#define MS_REMOUNT 32
|
||||
#define MS_MANDLOCK 64
|
||||
#define MS_DIRSYNC 128
|
||||
#define MS_NOATIME 1024
|
||||
#define MS_NODIRATIME 2048
|
||||
#define MS_BIND 4096
|
||||
#define MS_MOVE 8192
|
||||
#define MS_REC 16384
|
||||
#define MS_SILENT 32768
|
||||
#define MS_POSIXACL (1<<16)
|
||||
#define MS_UNBINDABLE (1<<17)
|
||||
#define MS_PRIVATE (1<<18)
|
||||
#define MS_SLAVE (1<<19)
|
||||
#define MS_SHARED (1<<20)
|
||||
#define MS_RELATIME (1<<21)
|
||||
#define MS_KERNMOUNT (1<<22)
|
||||
#define MS_I_VERSION (1<<23)
|
||||
#define MS_STRICTATIME (1<<24)
|
||||
#define MS_LAZYTIME (1<<25)
|
||||
#define MS_NOREMOTELOCK (1<<27)
|
||||
#define MS_NOSEC (1<<28)
|
||||
#define MS_BORN (1<<29)
|
||||
#define MS_ACTIVE (1<<30)
|
||||
#define MS_NOUSER (1U<<31)
|
||||
|
||||
#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_I_VERSION|MS_LAZYTIME)
|
||||
|
||||
/* file system partition table */
|
||||
struct dfs_partition
|
||||
{
|
||||
@@ -87,6 +119,7 @@ int dfs_unregister(struct dfs_filesystem_type *fs);
|
||||
int dfs_register(struct dfs_filesystem_type *fs);
|
||||
const char *dfs_filesystem_get_mounted_path(struct rt_device *device);
|
||||
|
||||
int dfs_remount(const char *path, rt_ubase_t flags, void *data);
|
||||
int dfs_mount(const char *device_name,
|
||||
const char *path,
|
||||
const char *filesystemtype,
|
||||
|
@@ -39,6 +39,8 @@ struct dfs_mnt
|
||||
#define MNT_IS_UMOUNT 0x8 /* the mnt is unmount */
|
||||
#define MNT_IS_LOCKED 0x10 /* the mnt is locked */
|
||||
#define MNT_FORCE 0x20 /* the mnt force unmount */
|
||||
#define MNT_LAZY_UMNT 0x40 /* the mnt has pending umount */
|
||||
#define MNT_RDONLY 0x80 /* the mnt is read only */
|
||||
|
||||
rt_atomic_t ref_count; /* reference count */
|
||||
|
||||
@@ -60,9 +62,16 @@ const char *dfs_mnt_get_mounted_path(struct rt_device *device);
|
||||
struct dfs_mnt* dfs_mnt_ref(struct dfs_mnt* mnt);
|
||||
int dfs_mnt_unref(struct dfs_mnt* mnt);
|
||||
|
||||
int dfs_mnt_umount(struct dfs_mnt *mnt, int flags);
|
||||
int dfs_mnt_setflags(struct dfs_mnt *mnt, int flags);
|
||||
|
||||
rt_bool_t dfs_mnt_has_child_mnt(struct dfs_mnt *mnt, const char* fullpath);
|
||||
|
||||
int dfs_mnt_foreach(struct dfs_mnt* (*func)(struct dfs_mnt *mnt, void *parameter), void *parameter);
|
||||
int dfs_mnt_umount_iter(rt_bool_t (*filter)(struct dfs_mnt *mnt, void *parameter), void *parameter);
|
||||
|
||||
typedef void (*dfs_mnt_umnt_cb_t)(struct dfs_mnt *mnt);
|
||||
RT_OBJECT_HOOKLIST_DECLARE(dfs_mnt_umnt_cb_t, dfs_mnt_umnt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -118,6 +118,7 @@ int dfs_aspace_mmap_write(struct dfs_file *file, struct rt_varea *varea, void *d
|
||||
|
||||
void dfs_pcache_release(size_t count);
|
||||
void dfs_pcache_unmount(struct dfs_mnt *mnt);
|
||||
void dfs_pcache_clean(struct dfs_mnt *mnt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ static inline void dfs_seq_setwidth(struct dfs_seq_file *seq, size_t size)
|
||||
|
||||
int dfs_seq_open(struct dfs_file *file, const struct dfs_seq_ops *ops);
|
||||
ssize_t dfs_seq_read(struct dfs_file *file, void *buf, size_t size, off_t *pos);
|
||||
ssize_t dfs_seq_lseek(struct dfs_file *file, off_t offset, int whence);
|
||||
off_t dfs_seq_lseek(struct dfs_file *file, off_t offset, int whence);
|
||||
int dfs_seq_release(struct dfs_file *file);
|
||||
int dfs_seq_write(struct dfs_seq_file *seq, const void *data, size_t len);
|
||||
|
||||
|
50
rt-thread/components/dfs/dfs_v2/include/dfs_vfs.h
Normal file
50
rt-thread/components/dfs/dfs_v2/include/dfs_vfs.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2024, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
*/
|
||||
|
||||
#ifndef __DFS_VFS_H__
|
||||
#define __DFS_VFS_H__
|
||||
|
||||
#include "dfs_file.h"
|
||||
#include "dfs_fs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct dfs_vfs_node
|
||||
{
|
||||
rt_list_t subnode; /* file subnode list */
|
||||
rt_list_t sibling; /* file sibling list */
|
||||
};
|
||||
|
||||
rt_inline void dfs_vfs_init_node(struct dfs_vfs_node *node)
|
||||
{
|
||||
rt_list_init(&node->subnode);
|
||||
rt_list_init(&node->sibling);
|
||||
}
|
||||
|
||||
rt_inline void dfs_vfs_append_node(struct dfs_vfs_node *dir, struct dfs_vfs_node *node)
|
||||
{
|
||||
rt_list_insert_after(&(dir->subnode), &(node->sibling));
|
||||
}
|
||||
|
||||
rt_inline void dfs_vfs_remove_node(struct dfs_vfs_node *node)
|
||||
{
|
||||
rt_list_remove(&(node->sibling));
|
||||
}
|
||||
|
||||
#define dfs_vfs_for_each_subnode(node, tmp, dir, member) \
|
||||
rt_list_for_each_entry_safe(node, tmp, &dir->member.subnode, member.sibling)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*__DFS_VFS_H__*/
|
Reference in New Issue
Block a user