|
AquilaOS documentation
How it works, and its code
|
ext2: loading and mounting the filesystem, and the vnodes of its inodes. More...
#include <core/panic.h>#include <core/module.h>#include <fs/vfs.h>#include <fs/posix.h>#include <fs/vcache.h>#include <aquila/errno.h>#include <ds/bitmap.h>#include <ext2.h>Go to the source code of this file.
Functions | |
| int | ext2_inode_build (struct ext2 *desc, ino_t ino, struct vnode **ref_inode) |
| Gets the vnode of an inode: the cached one if it's in use, or a new one made from the inode on the disk. | |
| int | ext2_inode_sync (struct vnode *inode) |
| Writes a vnode's attributes back to its inode on the disk. | |
| int | ext2_init () |
| Installs the ext2 filesystem at boot. | |
| int | ext2_load (struct vnode *dev, struct vnode **super) |
| Loads an ext2 filesystem from a device: its superblock, its block group descriptors, and its root directory's vnode. | |
| int | ext2_mount (struct vnode *dir, int flags, void *_args) |
| Mounts the ext2 filesystem of a device on a directory. | |
Variables | |
| struct fs | ext2fs |
ext2: loading and mounting the filesystem, and the vnodes of its inodes.
The block group descriptors are kept in memory, and the vnodes in use in a cache by inode number. See ext2.h for the disk's format.
Definition in file ext2.c.
| int ext2_init | ( | ) |
Installs the ext2 filesystem at boot.
Definition at line 130 of file ext2.c.
References ext2_init(), ext2fs, and vfs_install().
Referenced by ext2_init().
Gets the vnode of an inode: the cached one if it's in use, or a new one made from the inode on the disk.
| desc | the mounted filesystem |
| ino | the inode number |
| ref_inode | if not NULL, set to the vnode |
Definition at line 29 of file ext2.c.
References ext2_inode::atime, vnode::atime, ext2_inode::ctime, vnode::ctime, DEV, ext2_inode::direct_pointer, ext2_inode_build(), ext2_inode_read(), ext2fs, vnode::fs, ext2_inode::gid, vnode::gid, vnode::ino, kmalloc(), LOG_DEBUG, M_ZERO, ext2_inode::mode, vnode::mode, ext2_inode::mtime, vnode::mtime, ext2_inode::nlink, vnode::nlink, NULL, vnode::p, vnode::rdev, ext2_inode::size, vnode::size, timespec::tv_nsec, timespec::tv_sec, ext2_inode::uid, vnode::uid, ext2::vcache, vcache_find(), and vcache_insert().
Referenced by ext2_inode_build(), ext2_load(), ext2_vget(), ext2_vmknod(), ext2_vrename(), and ext2_vunlink().
| int ext2_inode_sync | ( | struct vnode * | inode | ) |
Writes a vnode's attributes back to its inode on the disk.
| inode | the vnode |
Definition at line 93 of file ext2.c.
References ext2_inode::atime, vnode::atime, ext2_inode::ctime, vnode::ctime, ext2_inode_read(), ext2_inode_sync(), ext2_inode_write(), ext2_inode::gid, vnode::gid, vnode::ino, LOG_DEBUG, ext2_inode::mode, vnode::mode, ext2_inode::mtime, vnode::mtime, ext2_inode::nlink, vnode::nlink, vnode::p, ext2_inode::size, vnode::size, timespec::tv_sec, ext2_inode::uid, and vnode::uid.
Referenced by ext2_inode_sync(), ext2_trunc(), ext2_vlink(), ext2_vmknod(), ext2_vrename(), and ext2_vunlink().
Loads an ext2 filesystem from a device: its superblock, its block group descriptors, and its root directory's vnode.
| dev | the device |
| super | if not NULL, set to the root directory's vnode |
Definition at line 144 of file ext2.c.
References ext2_superblock::block_size, ext2::bs, EXT2_GOOD_OLD_INODE_SIZE, EXT2_INCOMPAT_FILETYPE, EXT2_INCOMPAT_SUPPORTED, ext2_inode_build(), ext2_load(), EXT2_RO_COMPAT_SUPPORTED, EXT2_SIGNATURE, ext2_superblock::ext2_signature, ext2_superblock::feature_incompat, ext2_superblock::feature_ro_compat, ext2::filetype, ext2_superblock::gblocks, ext2::groups, vcache::hashmap, ext2::inode_size, ext2_superblock::inode_size, kfree(), kmalloc(), M_ZERO, ext2_superblock::major_version, ext2_superblock::nblocks, ext2::ngroups, NULL, printk(), ext2::superblock, ext2::supernode, ext2::vcache, vcache_init(), and vfs_read().
Referenced by ext2_load().
| int ext2_mount | ( | struct vnode * | dir, |
| int | flags, | ||
| void * | _args ) |
Mounts the ext2 filesystem of a device on a directory.
| dir | the directory |
| flags | not used |
| _args | the arguments, whose dev is the device's path |
Definition at line 253 of file ext2.c.
References ext2_mount(), ext2fs, fs::load, NULL, vfs_bind(), and vfs_lookup().
Referenced by ext2_mount().
| struct fs ext2fs |
Definition at line 282 of file ext2.c.
Referenced by ext2_init(), ext2_inode_build(), and ext2_mount().