RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
|
结构体 | |
struct | dfs_file_ops |
struct | dfs_vnode |
struct | dfs_file |
宏定义 | |
#define | STDIN_FILENO 0 /* standard input file descriptor */ |
#define | STDOUT_FILENO 1 /* standard output file descriptor */ |
#define | STDERR_FILENO 2 /* standard error file descriptor */ |
#define | DFS_FD_MAGIC 0xfdfd |
#define | DFS_FILE_POS(dfs_file) |
#define | FMODE_READ 0x1 |
#define | FMODE_WRITE 0x2 |
#define | FMODE_LSEEK 0x4 |
#define | FMODE_PREAD 0x8 |
#define | FMODE_PWRITE 0x10 |
#define | FMODE_EXEC 0x20 |
#define | FMODE_NDELAY 0x40 |
#define | FMODE_EXCL 0x80 |
#define | RT_FIOFTRUNCATE 0x52540000U |
#define | RT_FIOGETADDR 0x52540001U |
#define | RT_FIOMMAP2 0x52540002U |
#define | DFS_REALPATH_EXCEPT_LAST 0 |
#define | DFS_REALPATH_EXCEPT_NONE 1 |
#define | DFS_REALPATH_ONLY_LAST 3 |
函数 | |
int | dfs_vnode_init (struct dfs_vnode *vnode, int type, const struct dfs_file_ops *fops) |
struct dfs_vnode * | dfs_vnode_create (void) |
int | dfs_vnode_destroy (struct dfs_vnode *vnode) |
struct dfs_vnode * | dfs_vnode_ref (struct dfs_vnode *vnode) |
void | dfs_vnode_unref (struct dfs_vnode *vnode) |
void | dfs_file_init (struct dfs_file *file) |
void | dfs_file_deinit (struct dfs_file *file) |
int | dfs_file_open (struct dfs_file *file, const char *path, int flags, mode_t mode) |
int | dfs_file_close (struct dfs_file *file) |
off_t | dfs_file_get_fpos (struct dfs_file *file) |
void | dfs_file_set_fpos (struct dfs_file *file, off_t fpos) |
ssize_t | dfs_file_pread (struct dfs_file *file, void *buf, size_t len, off_t offset) |
ssize_t | dfs_file_read (struct dfs_file *file, void *buf, size_t len) |
ssize_t | dfs_file_pwrite (struct dfs_file *file, const void *buf, size_t len, off_t offset) |
ssize_t | dfs_file_write (struct dfs_file *file, const void *buf, size_t len) |
off_t | generic_dfs_lseek (struct dfs_file *file, off_t offset, int whence) |
off_t | dfs_file_lseek (struct dfs_file *file, off_t offset, int wherece) |
int | dfs_file_stat (const char *path, struct stat *buf) |
int | dfs_file_lstat (const char *path, struct stat *buf) |
int | dfs_file_setattr (const char *path, struct dfs_attr *attr) |
int | dfs_file_fstat (struct dfs_file *file, struct stat *buf) |
int | dfs_file_ioctl (struct dfs_file *file, int cmd, void *args) |
int | dfs_file_fcntl (int fd, int cmd, unsigned long arg) |
int | dfs_file_fsync (struct dfs_file *file) |
int | dfs_file_unlink (const char *path) |
int | dfs_file_link (const char *oldname, const char *newname) |
int | dfs_file_symlink (const char *oldname, const char *name) |
int | dfs_file_readlink (const char *path, char *buf, int bufsize) |
int | dfs_file_rename (const char *old_file, const char *new_file) |
int | dfs_file_ftruncate (struct dfs_file *file, off_t length) |
int | dfs_file_getdents (struct dfs_file *file, struct dirent *dirp, size_t nbytes) |
int | dfs_file_mkdir (const char *path, mode_t mode) |
int | dfs_file_rmdir (const char *pathname) |
int | dfs_file_isdir (const char *path) |
int | dfs_file_access (const char *path, mode_t mode) |
int | dfs_file_chdir (const char *path) |
char * | dfs_file_getcwd (char *buf, size_t size) |
char * | dfs_file_realpath (struct dfs_mnt **mnt, const char *fullpath, int mode) |
#define STDIN_FILENO 0 /* standard input file descriptor */ |
在文件 dfs_file.h 第 23 行定义.
#define STDOUT_FILENO 1 /* standard output file descriptor */ |
在文件 dfs_file.h 第 24 行定义.
#define STDERR_FILENO 2 /* standard error file descriptor */ |
在文件 dfs_file.h 第 25 行定义.
#define DFS_FD_MAGIC 0xfdfd |
在文件 dfs_file.h 第 84 行定义.
#define DFS_FILE_POS | ( | dfs_file | ) |
在文件 dfs_file.h 第 104 行定义.
#define FMODE_READ 0x1 |
在文件 dfs_file.h 第 107 行定义.
#define FMODE_WRITE 0x2 |
在文件 dfs_file.h 第 109 行定义.
#define FMODE_LSEEK 0x4 |
在文件 dfs_file.h 第 111 行定义.
#define FMODE_PREAD 0x8 |
在文件 dfs_file.h 第 113 行定义.
#define FMODE_PWRITE 0x10 |
在文件 dfs_file.h 第 115 行定义.
#define FMODE_EXEC 0x20 |
在文件 dfs_file.h 第 117 行定义.
#define FMODE_NDELAY 0x40 |
在文件 dfs_file.h 第 119 行定义.
#define FMODE_EXCL 0x80 |
在文件 dfs_file.h 第 121 行定义.
#define RT_FIOFTRUNCATE 0x52540000U |
在文件 dfs_file.h 第 188 行定义.
#define RT_FIOGETADDR 0x52540001U |
在文件 dfs_file.h 第 189 行定义.
#define RT_FIOMMAP2 0x52540002U |
在文件 dfs_file.h 第 190 行定义.
#define DFS_REALPATH_EXCEPT_LAST 0 |
在文件 dfs_file.h 第 193 行定义.
#define DFS_REALPATH_EXCEPT_NONE 1 |
在文件 dfs_file.h 第 194 行定义.
#define DFS_REALPATH_ONLY_LAST 3 |
在文件 dfs_file.h 第 195 行定义.
int dfs_vnode_init | ( | struct dfs_vnode * | vnode, |
int | type, | ||
const struct dfs_file_ops * | fops ) |
在文件 dfs_vnode.c 第 21 行定义.
引用了 dfs_vnode::fops, dfs_vnode::mnt, dfs_vnode::ref_count, rt_atomic_store, RT_NULL , 以及 dfs_vnode::type.
struct dfs_vnode * dfs_vnode_create | ( | void | ) |
在文件 dfs_vnode.c 第 36 行定义.
引用了 LOG_E, LOG_I, dfs_vnode::ref_count, rt_atomic_store, rt_calloc() , 以及 RT_NULL.
int dfs_vnode_destroy | ( | struct dfs_vnode * | vnode | ) |
在文件 dfs_vnode.c 第 52 行定义.
引用了 dfs_vnode::aspace, dfs_file_lock(), dfs_file_unlock(), DLOG, dfs_filesystem_ops::free_vnode, dfs_mnt::fs_ops, LOG_I, dfs_vnode::mnt, dfs_filesystem_ops::name, dfs_vnode::ref_count, rt_atomic_load , 以及 rt_free().
在文件 dfs_vnode.c 第 94 行定义.
引用了 DLOG, dfs_vnode::ref_count, rt_atomic_add , 以及 rt_atomic_load.
void dfs_vnode_unref | ( | struct dfs_vnode * | vnode | ) |
在文件 dfs_vnode.c 第 106 行定义.
引用了 dfs_vnode::aspace, dfs_file_lock(), dfs_file_unlock(), DLOG, dfs_filesystem_ops::free_vnode, dfs_mnt::fs_ops, LOG_I, dfs_vnode::mnt, dfs_filesystem_ops::name, dfs_vnode::ref_count, rt_atomic_load, rt_atomic_sub , 以及 rt_free().
void dfs_file_init | ( | struct dfs_file * | file | ) |
在文件 dfs_file.c 第 189 行定义.
引用了 DFS_FD_MAGIC, dfs_file::magic, dfs_file::pos_lock, dfs_file::ref_count, rt_atomic_store, RT_IPC_FLAG_PRIO , 以及 rt_mutex_init().
void dfs_file_deinit | ( | struct dfs_file * | file | ) |
在文件 dfs_file.c 第 200 行定义.
引用了 dfs_file::pos_lock , 以及 rt_mutex_detach().
int dfs_file_open | ( | struct dfs_file * | file, |
const char * | path, | ||
int | oflags, | ||
mode_t | mode ) |
this function will open a file which specified by path with specified oflags.
fd | the file descriptor pointer to return the corresponding result. |
path | the specified file path. |
oflags | the oflags for open operator. |
在文件 dfs_file.c 第 409 行定义.
引用了 dfs_vnode::aspace, dfs_filesystem_ops::create_vnode, dfs_filesystem_ops::default_fops, dfs_file::dentry, dfs_dentry_create(), dfs_dentry_insert(), dfs_dentry_lookup(), dfs_dentry_unref(), DFS_F_FREAD, DFS_F_FWRITE, dfs_fflags(), dfs_file_lock(), dfs_file_realpath(), dfs_file_unlock(), dfs_is_mounted(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_LAST, DFS_REALPATH_ONLY_LAST, DLOG, dfs_file::flags, dfs_file::fops, dfs_vnode::fops, dfs_mnt::fs_ops, dfs_mnt::fullpath, LOG_I, dfs_dentry::mnt, dfs_vnode::mnt, dfs_vnode::mode, dfs_filesystem_ops::name, dfs_file_ops::open, RT_FALSE, rt_free(), RT_NULL, RT_TRUE, dfs_file_ops::truncate, dfs_vnode::type, dfs_dentry::vnode , 以及 dfs_file::vnode.
int dfs_file_close | ( | struct dfs_file * | file | ) |
在文件 dfs_file.c 第 670 行定义.
引用了 dfs_vnode::aspace, dfs_file_ops::close, dfs_file::dentry, dfs_file_lock(), dfs_file_unlock(), DLOG, dfs_file::fops, dfs_mnt::fs_ops, LOG_W, dfs_dentry::mnt, dfs_filesystem_ops::name, dfs_dentry::pathname, dfs_file::ref_count, dfs_vnode::ref_count, rt_atomic_load , 以及 dfs_file::vnode.
off_t dfs_file_get_fpos | ( | struct dfs_file * | file | ) |
在文件 dfs_file.c 第 162 行定义.
引用了 dfs_file::fpos, dfs_file::pos_lock, rt_mutex_take(), RT_WAITING_FOREVER, dfs_vnode::type , 以及 dfs_file::vnode.
void dfs_file_set_fpos | ( | struct dfs_file * | file, |
off_t | fpos ) |
在文件 dfs_file.c 第 176 行定义.
引用了 dfs_file::fpos, dfs_file::pos_lock, rt_mutex_release(), rt_mutex_take(), RT_WAITING_FOREVER, dfs_vnode::type , 以及 dfs_file::vnode.
ssize_t dfs_file_pread | ( | struct dfs_file * | file, |
void * | buf, | ||
size_t | len, | ||
off_t | offset ) |
在文件 dfs_file.c 第 714 行定义.
引用了 dfs_vnode::aspace, DFS_F_FREAD, dfs_fflags(), dfs_is_mounted(), dfs_file::flags, dfs_file::fops, dfs_vnode::mnt, dfs_file_ops::read, rw_verify_area(), dfs_vnode::type , 以及 dfs_file::vnode.
ssize_t dfs_file_read | ( | struct dfs_file * | file, |
void * | buf, | ||
size_t | len ) |
在文件 dfs_file.c 第 762 行定义.
引用了 dfs_vnode::aspace, DFS_F_FREAD, dfs_fflags(), dfs_file_get_fpos(), dfs_file_set_fpos(), dfs_is_mounted(), dfs_file::flags, dfs_file::fops, dfs_vnode::mnt, dfs_file_ops::read, rw_verify_area(), dfs_vnode::type , 以及 dfs_file::vnode.
ssize_t dfs_file_pwrite | ( | struct dfs_file * | file, |
const void * | buf, | ||
size_t | len, | ||
off_t | offset ) |
在文件 dfs_file.c 第 813 行定义.
引用了 dfs_vnode::aspace, dfs_file::dentry, DFS_F_FWRITE, dfs_fflags(), dfs_is_mounted(), DLOG, dfs_file::flags, dfs_file_ops::flush, dfs_file::fops, dfs_mnt::fs_ops, LOG_W, dfs_dentry::mnt, dfs_vnode::mnt, dfs_filesystem_ops::name, rw_verify_area(), dfs_vnode::type, dfs_file::vnode , 以及 dfs_file_ops::write.
ssize_t dfs_file_write | ( | struct dfs_file * | file, |
const void * | buf, | ||
size_t | len ) |
在文件 dfs_file.c 第 869 行定义.
引用了 dfs_vnode::aspace, dfs_file::dentry, DFS_F_FWRITE, dfs_fflags(), dfs_file_get_fpos(), dfs_file_set_fpos(), dfs_is_mounted(), DLOG, dfs_file::flags, dfs_file_ops::flush, dfs_file::fops, dfs_mnt::fs_ops, LOG_W, dfs_dentry::mnt, dfs_vnode::mnt, dfs_filesystem_ops::name, rw_verify_area(), dfs_vnode::size, dfs_vnode::type, dfs_file::vnode , 以及 dfs_file_ops::write.
off_t generic_dfs_lseek | ( | struct dfs_file * | file, |
off_t | offset, | ||
int | whence ) |
在文件 dfs_file.c 第 940 行定义.
引用了 dfs_file::fpos, dfs_vnode::size , 以及 dfs_file::vnode.
off_t dfs_file_lseek | ( | struct dfs_file * | file, |
off_t | offset, | ||
int | wherece ) |
在文件 dfs_file.c 第 956 行定义.
引用了 dfs_file_get_fpos(), dfs_file_set_fpos(), dfs_is_mounted(), dfs_file::fops, dfs_file_ops::lseek, dfs_vnode::mnt , 以及 dfs_file::vnode.
int dfs_file_stat | ( | const char * | path, |
struct stat * | buf ) |
在文件 dfs_file.c 第 979 行定义.
引用了 dfs_dentry_lookup(), dfs_dentry_unref(), dfs_file_realpath(), dfs_is_mounted(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_NONE, DLOG, dfs_mnt::fs_ops, dfs_dentry::mnt, dfs_filesystem_ops::name, rt_free(), RT_NULL, dfs_filesystem_ops::stat , 以及 stat().
int dfs_file_lstat | ( | const char * | path, |
struct stat * | buf ) |
在文件 dfs_file.c 第 1033 行定义.
引用了 dfs_dentry_lookup(), dfs_dentry_unref(), dfs_file_realpath(), dfs_is_mounted(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_LAST, DLOG, dfs_mnt::fs_ops, dfs_dentry::mnt, dfs_filesystem_ops::name, rt_free(), RT_NULL, dfs_filesystem_ops::stat , 以及 stat().
int dfs_file_setattr | ( | const char * | path, |
struct dfs_attr * | attr ) |
在文件 dfs_file.c 第 1112 行定义.
引用了 dfs_dentry_lookup(), dfs_dentry_unref(), dfs_file_realpath(), dfs_is_mounted(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_LAST, DLOG, dfs_mnt::fs_ops, dfs_dentry::mnt, dfs_filesystem_ops::name, rt_free(), RT_NULL , 以及 dfs_filesystem_ops::setattr.
在文件 dfs_file.c 第 1089 行定义.
引用了 dfs_file::fops, dfs_file_ops::ioctl , 以及 stat().
int dfs_file_ioctl | ( | struct dfs_file * | file, |
int | cmd, | ||
void * | args ) |
在文件 dfs_file.c 第 1162 行定义.
引用了 dfs_is_mounted(), dfs_file::fops, dfs_file_ops::ioctl, dfs_vnode::mnt , 以及 dfs_file::vnode.
int dfs_file_fcntl | ( | int | fd, |
int | cmd, | ||
unsigned long | arg ) |
在文件 dfs_file.c 第 1192 行定义.
引用了 dfs_dup(), fd_get(), dfs_file::flags , 以及 dfs_file::mode.
int dfs_file_fsync | ( | struct dfs_file * | file | ) |
在文件 dfs_file.c 第 1257 行定义.
引用了 dfs_vnode::aspace, dfs_is_mounted(), dfs_file_ops::flush, dfs_file::fops, dfs_vnode::mnt , 以及 dfs_file::vnode.
int dfs_file_unlink | ( | const char * | path | ) |
在文件 dfs_file.c 第 1285 行定义.
引用了 dfs_vnode::aspace, dfs_dentry_lookup(), dfs_dentry_unref(), dfs_file_lock(), dfs_file_realpath(), dfs_file_unlock(), dfs_is_mounted(), dfs_mnt_has_child_mnt(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_LAST, DLOG, dfs_mnt::fs_ops, dfs_mnt::fullpath, dfs_dentry::mnt, RT_FALSE, rt_free(), RT_NULL, dfs_filesystem_ops::unlink , 以及 dfs_dentry::vnode.
int dfs_file_link | ( | const char * | oldname, |
const char * | newname ) |
在文件 dfs_file.c 第 1373 行定义.
引用了 dfs_dentry_create(), dfs_dentry_lookup(), dfs_dentry_unref(), dfs_file_isdir(), dfs_file_lstat(), dfs_file_realpath(), dfs_is_mounted(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_LAST, DLOG, dfs_mnt::fs_ops, dfs_filesystem_ops::link, dfs_dentry::mnt, rt_free(), RT_NULL , 以及 stat().
int dfs_file_symlink | ( | const char * | oldname, |
const char * | name ) |
在文件 dfs_file.c 第 1459 行定义.
引用了 dfs_dentry_lookup(), dfs_dentry_unref(), dfs_file_access(), dfs_file_realpath(), dfs_is_mounted(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_LAST, DLOG, dfs_mnt::fs_ops, dfs_dentry::mnt, rt_free(), rt_malloc(), RT_NULL , 以及 dfs_filesystem_ops::symlink.
int dfs_file_readlink | ( | const char * | path, |
char * | buf, | ||
int | bufsize ) |
在文件 dfs_file.c 第 1587 行定义.
引用了 dfs_dentry_lookup(), dfs_dentry_unref(), dfs_file_realpath(), dfs_is_mounted(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_LAST, DLOG, dfs_mnt::fs_ops, dfs_dentry::mnt, dfs_filesystem_ops::readlink, rt_free() , 以及 RT_NULL.
int dfs_file_rename | ( | const char * | old_file, |
const char * | new_file ) |
在文件 dfs_file.c 第 1649 行定义.
引用了 dfs_vnode::aspace, dfs_dentry_create(), dfs_dentry_lookup(), dfs_dentry_unref(), dfs_file_realpath(), dfs_is_mounted(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_LAST, DLOG, dfs_mnt::fs_ops, dfs_dentry::mnt, dfs_filesystem_ops::rename, rt_free(), RT_NULL , 以及 dfs_dentry::vnode.
int dfs_file_ftruncate | ( | struct dfs_file * | file, |
off_t | length ) |
在文件 dfs_file.c 第 1728 行定义.
引用了 dfs_vnode::aspace, dfs_is_mounted(), dfs_file::fops, dfs_vnode::mnt, dfs_file_ops::truncate , 以及 dfs_file::vnode.
int dfs_file_getdents | ( | struct dfs_file * | file, |
struct dirent * | dirp, | ||
size_t | nbytes ) |
在文件 dfs_file.c 第 1800 行定义.
引用了 dfs_file::dentry, dfs_is_mounted(), DLOG, dfs_file::fops, dfs_mnt::fs_ops, dfs_file_ops::getdents, dfs_dentry::mnt, dfs_vnode::mnt, dfs_vnode::mode, dfs_filesystem_ops::name , 以及 dfs_file::vnode.
int dfs_file_mkdir | ( | const char * | path, |
mode_t | mode ) |
int dfs_file_rmdir | ( | const char * | pathname | ) |
int dfs_file_isdir | ( | const char * | path | ) |
this function will check the path is it a directory.
path | the file path. |
在文件 dfs_file.c 第 1838 行定义.
引用了 dfs_dentry_lookup(), dfs_dentry_unref(), dfs_file_realpath(), dfs_is_mounted(), dfs_mnt_lookup(), dfs_normalize_path(), DFS_REALPATH_EXCEPT_NONE, DLOG, dfs_mnt::fs_ops, dfs_dentry::mnt, dfs_filesystem_ops::name, rt_free(), RT_NULL, dfs_filesystem_ops::stat , 以及 stat().
int dfs_file_access | ( | const char * | path, |
mode_t | mode ) |
在文件 dfs_file.c 第 1898 行定义.
引用了 dfs_file_close(), dfs_file_deinit(), dfs_file_init(), dfs_file_open() , 以及 dfs_file::mode.
int dfs_file_chdir | ( | const char * | path | ) |
char * dfs_file_getcwd | ( | char * | buf, |
size_t | size ) |
char * dfs_file_realpath | ( | struct dfs_mnt ** | mnt, |
const char * | fullpath, | ||
int | mode ) |
在文件 dfs_file.c 第 253 行定义.
引用了 _first_path_len(), dfs_mnt_lookup(), DFS_PATH_MAX, DFS_REALPATH_EXCEPT_LAST, DFS_REALPATH_ONLY_LAST, dfs_mnt::fullpath, rt_free(), rt_malloc() , 以及 RT_NULL.