|
ginnOS
The reference: libc, the libraries and the kernel
|
hard links, symbolic links, and the inodes with no data: named pipes and device nodes. More...
Macros | |
| #define | FAST_LINK_MAX ((uint32_t)sizeof(((ext2_inode_t *)0)->i_block)) |
Functions | |
| bool | inode_is_symlink (const ext2_inode_t *inode) |
| bool | inode_is_fast_symlink (const ext2_inode_t *inode) |
| kerr_t | ext2_find_link (ext2_volume_t *volume, const char *path, bool follow_last, char *target, uint32_t size, uint32_t *end_out) |
| find the first symbolic link along a path. | |
| kerr_t | ext2_readlink (ext2_volume_t *volume, const char *path, char *target, uint32_t size) |
| read a symbolic link's target, with a NUL. | |
| kerr_t | ext2_symlink (ext2_volume_t *volume, const char *path, const char *target) |
| make a symbolic link at path that points at target. | |
| kerr_t | ext2_link (ext2_volume_t *volume, const char *old_path, const char *new_path) |
| give the file at old_path one more name, new_path. | |
| kerr_t | ext2_mknod (ext2_volume_t *volume, const char *path, uint32_t mode, uint32_t major, uint32_t minor) |
| make a named pipe or a device node. | |
| void | ext2_device_numbers (const ext2_inode_t *inode, uint32_t *major, uint32_t *minor) |
| the numbers of a device node, as ext2_mknod stored them. | |
| bool | inode_has_no_blocks (const ext2_inode_t *inode) |
hard links, symbolic links, and the inodes with no data: named pipes and device nodes.
a hard link is one more directory entry for an inode: the inode counts its names in i_links_count, and its data stays until the last name goes.
a symbolic link is an inode of type S_IFLNK whose data is the path it points at. a short path (shorter than the 60 bytes of i_block) is kept in i_block itself, with no data block (a "fast" link, i_blocks 0). a longer path is in one data block, so a target is shorter than a block.
| #define FAST_LINK_MAX ((uint32_t)sizeof(((ext2_inode_t *)0)->i_block)) |
| bool inode_is_symlink | ( | const ext2_inode_t * | inode | ) |
| bool inode_is_fast_symlink | ( | const ext2_inode_t * | inode | ) |
| kerr_t ext2_find_link | ( | ext2_volume_t * | volume, |
| const char * | path, | ||
| bool | follow_last, | ||
| char * | target, | ||
| uint32_t | size, | ||
| uint32_t * | end_out ) |
find the first symbolic link along a path.
| follow_last | also the last name of the path, when it is a link. |
| target | gets the link's target, with a NUL. |
| end_out | gets the length of the path up to and with the link's name, or 0 when there is no link (or a name is missing). |
| kerr_t ext2_readlink | ( | ext2_volume_t * | volume, |
| const char * | path, | ||
| char * | target, | ||
| uint32_t | size ) |
read a symbolic link's target, with a NUL.
| kerr_t ext2_symlink | ( | ext2_volume_t * | volume, |
| const char * | path, | ||
| const char * | target ) |
make a symbolic link at path that points at target.
| kerr_t ext2_link | ( | ext2_volume_t * | volume, |
| const char * | old_path, | ||
| const char * | new_path ) |
give the file at old_path one more name, new_path.
| kerr_t ext2_mknod | ( | ext2_volume_t * | volume, |
| const char * | path, | ||
| uint32_t | mode, | ||
| uint32_t | major, | ||
| uint32_t | minor ) |
make a named pipe or a device node.
| mode | the type (EXT2_S_IFIFO, EXT2_S_IFCHR, EXT2_S_IFBLK) and the permission bits. |
| major | the device's numbers (a device node only). |
| void ext2_device_numbers | ( | const ext2_inode_t * | inode, |
| uint32_t * | major, | ||
| uint32_t * | minor ) |
the numbers of a device node, as ext2_mknod stored them.
| bool inode_has_no_blocks | ( | const ext2_inode_t * | inode | ) |