
在/ur/src/Linux/cinclude/Linux/dcache.h里
struct dentry {
int d_count;
unsigned int d_flags;
struct inode * d_inode; /* Where the name belongs to - NULL is negative */
struct dentry * d_parent; /* parent directory */
struct dentry * d_mounts; /* mount information */
struct dentry * d_covers;
struct list_head d_hash; /* lookup hash list */
struct list_head d_lru; /* d_count = 0 LRU list */
struct list_head d_child; /* child of parent list */
struct list_head d_subdirs; /* our
......
}
dentry是一个目录文件的入口。通过这个入口,我们可以很容易的在文件的父目录下移动。
例如,如果你一文件的inode是(struct inode*)file_inode,如果你可以用file_inode->d_entry来得到它的目录入口并且用file_inode->d_entry->d_parent来得到父目录的目录入口。
[责任编辑:editorforddvip]
相关链接
本栏更新