Chinaunix首页 | 论坛 | 博客
  • 博客访问: 285605
  • 博文数量: 49
  • 博客积分: 3083
  • 博客等级: 中校
  • 技术积分: 710
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-27 08:22
文章分类

全部博文(49)

文章存档

2009年(8)

2008年(41)

分类: LINUX

2008-09-07 10:52:04

struct dentry {
        atomic_t                 d_count;      /* 使用记数 */
        unsigned long            d_vfs_flags;  /* 目录缓存标志 */
        spinlock_t               d_lock;       /* 单目录项锁 */
        struct inode             *d_inode;     /* 相关索引及诶但 */
        struct list_head         d_lru;        /* 未使用链表 */
        struct list_head         d_child;      /* 副目录中目录项对象的链表 */
        struct list_head         d_subdirs;    /* 子目录*/
        struct list_head         d_alias;      /* 索引节点的别名链表 */
        unsigned long            d_time;       /* 重新声响的时间 */
        struct dentry_operations *d_op;        /* 目录项操作表 */
        struct super_block       *d_sb;        /* 文件超级块 */
        unsigned int             d_flags;      /* 目录项标识 */
        int                      d_mounted;    /* 可能是登陆点的目录项 */
        void                     *d_fsdata;    /* 文件系统特殊的数据 */
        struct rcu_head          d_rcu;        /* RCU锁 */
        struct dcookie_struct    *d_cookie;    /* cookie */
        struct dentry            *d_parent;    /* 父目录的目录项对象 */
        struct qstr              d_name;       /*目录项的名字?*/
        struct hlist_node        d_hash;       /* 散列表*/
        struct hlist_head        *d_bucket;    /* 散列表头 */
        unsigned char            d_iname[DNAME_INLINE_LEN_MIN]; /* 短文件名 */
};

struct dentry_operations {
        int (*d_revalidate) (struct dentry *, int);
        /*判断目录对象是否有效*/
        int (*d_hash) (struct dentry *, struct qstr *);
        /*问目录项生成散列表*/
        int (*d_compare) (struct dentry *, struct qstr *, struct qstr *);
        /*VFS调用该函数来比较name1和name2这两个文件名,使用该函数需要家dcache_lock锁。注意fat等不区分大小写的文件系统*/
        int (*d_delete) (struct dentry *);
        /*当目录项对象的d_count计数值等于0时,VFS调用该函数,使用该函数需要家dcache_lock锁*/
        void (*d_release) (struct dentry *);
        /*当目录项对象将要被释放时,VFS调用该函数,默认情况下,什么都不做*/
        void (*d_iput) (struct dentry *, struct inode *);
        /*当目录项对象丢失了其相关的索引节点时,VFS调用该函数。默认情况下VFS会调用iput()函数释放索引节点。如果文件系统重载了该函数,那么除了执行此文件系统的特殊的工作外,还必须调用iput()函数*/
};

阅读(1361) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~