LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 784|回复: 2

文件夹在内核中是怎样描述的?数据结构在那个文件当中呀?

[复制链接]
发表于 2005-11-14 21:46:42 | 显示全部楼层 |阅读模式
文件夹在内核中是怎样描述的?数据结构在那个文件当中呀?
找;了一个晚上也没找到
发表于 2005-11-14 23:35:55 | 显示全部楼层
include/linux/dcache.h:


  1. struct dentry {
  2.         atomic_t d_count;
  3.         unsigned int d_flags;
  4.         struct inode  * d_inode;        /* Where the name belongs to - NULL is negative */
  5.         struct dentry * d_parent;       /* parent directory */
  6.         struct list_head d_hash;        /* lookup hash list */
  7.         struct list_head d_lru;         /* d_count = 0 LRU list */
  8.         struct list_head d_child;       /* child of parent list */
  9.         struct list_head d_subdirs;     /* our children */
  10.         struct list_head d_alias;       /* inode alias list */
  11.         int d_mounted;
  12.         struct qstr d_name;
  13.         unsigned long d_time;           /* used by d_revalidate */
  14.         struct dentry_operations  *d_op;
  15.         struct super_block * d_sb;      /* The root of the dentry tree */
  16.         unsigned long d_vfs_flags;
  17.         void * d_fsdata;                /* fs-specific data */
  18.         unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
  19. };

  20. struct dentry_operations {
  21.         int (*d_revalidate)(struct dentry *, int);
  22.         int (*d_hash) (struct dentry *, struct qstr *);
  23.         int (*d_compare) (struct dentry *, struct qstr *, struct qstr *);
  24.         int (*d_delete)(struct dentry *);
  25.         void (*d_release)(struct dentry *);
  26.         void (*d_iput)(struct dentry *, struct inode *);
  27. };

复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-15 12:19:16 | 显示全部楼层
原来还是在dentry当中定义的
被小师妹猜中了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表