- 论坛徽章:
- 0
|
比如 kernfs_node这个结构体中有些成员没有注释。我想知道各个成员的用途或者目的。比如void* priv
98 * kernfs_node - the building block of kernfs hierarchy. Each and every
99 * kernfs node is represented by single kernfs_node. Most fields are
100 * private to kernfs and shouldn't be accessed directly by kernfs users.
101 *
102 * As long as s_count reference is held, the kernfs_node itself is
103 * accessible. Dereferencing elem or any other outer entity requires
104 * active reference.
105 */
106 struct kernfs_node {
107 atomic_t count;
108 atomic_t active;
109 #ifdef CONFIG_DEBUG_LOCK_ALLOC
110 struct lockdep_map dep_map;
111 #endif
112 /*
113 * Use kernfs_get_parent() and kernfs_name/path() instead of
114 * accessing the following two fields directly. If the node is
115 * never moved to a different parent, it is safe to access the
116 * parent directly.
117 */
118 struct kernfs_node *parent;
119 const char *name;
120
121 struct rb_node rb;
122
123 const void *ns; /* namespace tag */
124 unsigned int hash; /* ns + name hash */
125 union {
126 struct kernfs_elem_dir dir;
127 struct kernfs_elem_symlink symlink;
128 struct kernfs_elem_attr attr;
129 };
130
131 void *priv;
132
133 unsigned short flags;
134 umode_t mode;
135 unsigned int ino;
136 struct kernfs_iattrs *iattr;
137 };
|
|