|
AquilaOS documentation
How it works, and its code
|
ext2: directory entries. More...
#include <ext2.h>Go to the source code of this file.
Functions | |
| int | ext2_dentry_find (struct ext2 *desc, struct ext2_inode *inode, const char *name, ino_t *ino) |
| Finds the inode number of a name in a directory. | |
| static uint8_t | ext2_dentry_type (mode_t mode) |
| Returns the directory entry type of a file's mode. | |
| int | ext2_dentry_create (struct vnode *dir, const char *name, ino_t ino, mode_t mode) |
| Adds an entry to a directory. | |
ext2: directory entries.
A directory's blocks hold entries of different sizes, each saying where the next one is (its size); an entry with no inode is unused, and a new entry takes an unused one, the room left at the end of another, or a new block.
Definition in file dentry.c.
Adds an entry to a directory.
It takes an unused entry big enough, or splits an entry that has room after its name, or else gets a new block at the end of the directory.
| dir | the directory |
| name | the new entry's name |
| ino | its inode number |
| mode | its file's mode (for the entry's type) |
Definition at line 87 of file dentry.c.
References ext2::bs, ext2_dentry_create(), ext2_dentry_type(), ext2_inode_block_read(), ext2_inode_block_write(), ext2_inode_read(), ext2_inode_write(), ext2::filetype, ext2_dentry::ino, vnode::ino, kfree(), kmalloc(), ext2_dentry::length, memcpy(), memset(), vnode::mode, ext2_dentry::name, NULL, vnode::p, ext2_dentry::size, ext2_inode::size, vnode::size, and ext2_dentry::type.
Referenced by ext2_dentry_create(), ext2_vlink(), ext2_vmknod(), and ext2_vrename().
| int ext2_dentry_find | ( | struct ext2 * | desc, |
| struct ext2_inode * | inode, | ||
| const char * | name, | ||
| ino_t * | ino ) |
Finds the inode number of a name in a directory.
| desc | the mounted filesystem |
| inode | the directory's inode |
| name | the name |
| ino | set to the inode number |
Definition at line 20 of file dentry.c.
References ext2::bs, ext2_dentry_find(), ext2_inode_block_read(), ext2_dentry::ino, kfree(), kmalloc(), ext2_dentry::length, memcmp(), ext2_inode::mode, ext2_dentry::name, ext2_dentry::size, and ext2_inode::size.
Referenced by ext2_dentry_find(), ext2_finddir(), ext2_vlink(), ext2_vmknod(), and ext2_vrename().
Returns the directory entry type of a file's mode.
Definition at line 62 of file dentry.c.
References ext2_dentry_type(), EXT2_DENTRY_TYPE_BAD, EXT2_DENTRY_TYPE_BLK, EXT2_DENTRY_TYPE_CHR, EXT2_DENTRY_TYPE_DIR, EXT2_DENTRY_TYPE_FIFO, EXT2_DENTRY_TYPE_RGL, EXT2_DENTRY_TYPE_SCKT, and EXT2_DENTRY_TYPE_SLINK.
Referenced by ext2_dentry_create(), and ext2_dentry_type().