Device Filesystem.
More...
Device Filesystem.
The devfs is a virtual filesystem that provides access to devices and resources.
|
| #define | DEVFS_NAME "devfs" |
| | The name of the device filesystem.
|
| |
|
| void | devfs_init (void) |
| | Initializes the devfs.
|
| |
| dentry_t * | devfs_dir_new (dentry_t *parent, const char *name, const vnode_ops_t *vnodeOps, void *data) |
| | Create a new directory inside a mounted devfs instance.
|
| |
| dentry_t * | devfs_file_new (dentry_t *parent, const char *name, const vnode_ops_t *vnodeOps, const file_ops_t *fileOps, void *data) |
| | Create a new file inside a mounted devfs instance.
|
| |
| dentry_t * | devfs_symlink_new (dentry_t *parent, const char *name, const vnode_ops_t *vnodeOps, void *data) |
| | Create a new symbolic link inside a mounted devfs instance.
|
| |
| uint64_t | devfs_files_new (list_t *out, dentry_t *parent, const devfs_file_desc_t *descs) |
| | Create multiple files in a devfs directory.
|
| |
| void | devfs_files_free (list_t *files) |
| | Free all files in a list created by devfs_files_new().
|
| |
◆ DEVFS_NAME
| #define DEVFS_NAME "devfs" |
The name of the device filesystem.
Definition at line 26 of file devfs.h.
◆ devfs_init()
Initializes the devfs.
Definition at line 50 of file devfs.c.
◆ devfs_dir_new()
Create a new directory inside a mounted devfs instance.
- Parameters
-
| parent | The parent directory, if NULL then the root is used. |
| name | The name of the new directory. |
| vnodeOps | The vnode operations for the new directory, can be NULL. |
| private | Private data to store in the vnode of the new directory, can be NULL. |
- Returns
- On success, the new devfs directory. On failure,
NULL and errno is set.
Definition at line 82 of file devfs.c.
◆ devfs_file_new()
Create a new file inside a mounted devfs instance.
- Parameters
-
| parent | The parent directory, if NULL then the root is used. |
| name | The name of the new file. |
| vnodeOps | The vnode operations for the new file, can be NULL. |
| fileOps | The file operations for the new file, can be NULL. |
| private | Private data to store in the vnode of the new file, can be NULL. |
- Returns
- On success, the new devfs file. On failure,
NULL and errno is set.
Definition at line 121 of file devfs.c.
◆ devfs_symlink_new()
Create a new symbolic link inside a mounted devfs instance.
- Parameters
-
| parent | The parent directory, if NULL then the root is used. |
| name | The name of the new symbolic link. |
| vnodeOps | The vnode operations for the new symbolic link. |
| private | Private data to store in the vnode of the new symbolic link, can be NULL. |
- Returns
- On success, the new devfs symbolic link. On failure,
NULL and errno is set.
Definition at line 161 of file devfs.c.
◆ devfs_files_new()
Create multiple files in a devfs directory.
- Parameters
-
| out | Output list to store created dentries, can be NULL. The dentries use the otherEntry list entry. |
| parent | The parent directory, if NULL then the root is used. |
| descs | Array of file descriptors, terminated by an entry with name == NULL. |
- Returns
- On success, the number of files created. On failure,
ERR and errno is set.
Definition at line 195 of file devfs.c.
◆ devfs_files_free()
| void devfs_files_free |
( |
list_t * |
files | ) |
|
Free all files in a list created by devfs_files_new().
- Parameters
-
| files | The list of files to free. |
Definition at line 250 of file devfs.c.