Log结构化文件系统中的符号链接

时间:2012-11-03 21:28:31

标签: operating-system

我正在做一个关于Log结构文件系统的项目,我正在做项目的中途,已经创建了普通文件和目录的inode,现在我想处理符号链接。

这是我的inode的结构。

int8_t is_active;

/* inode no. of the file */
uint16_t inode_number;

/* the most up-to-date version id */
uint8_t latest_version_id;

/* Details about the direct block */
BlockInfo direct_block[4];

/* Details about the indirect block */
BlockInfo indirect_block;

/* The type, permissions, etc. */
unsigned long inode_mode;

/* The user id */
//unsigned short uid;

/* The group id */
//unsigned short gid;

/* The number of links to the inode */
unsigned short number_of_links;

/* The size of the file, in bytes.
 * If it is a directory file, this will contain the number of
 * immediate children in the directory.
 *
 * If it is a regular file, it will contain the actual file size*/
unsigned long int file_size;

/* The number of blocks used by the inode */
unsigned long number_of_blocks;

/* The creation time of the file */
struct timeval creation_time;

/* The modification time of the file */
struct timeval modification_time;

struct timeval access_time;

任何人都可以帮我创建符号链接。

1 个答案:

答案 0 :(得分:0)

符号链接是一个常规文件,其中包含目标的路径名。使用模式位使文件系统代码读取链接并在打开,创建,取消链接等时执行重定向。