• Home
  • Raw
  • Download

Lines Matching refs:n

94 static void add_head(struct klist *k, struct klist_node *n)  in add_head()  argument
97 list_add(&n->n_node, &k->k_list); in add_head()
101 static void add_tail(struct klist *k, struct klist_node *n) in add_tail() argument
104 list_add_tail(&n->n_node, &k->k_list); in add_tail()
108 static void klist_node_init(struct klist *k, struct klist_node *n) in klist_node_init() argument
110 INIT_LIST_HEAD(&n->n_node); in klist_node_init()
111 kref_init(&n->n_ref); in klist_node_init()
112 knode_set_klist(n, k); in klist_node_init()
114 k->get(n); in klist_node_init()
122 void klist_add_head(struct klist_node *n, struct klist *k) in klist_add_head() argument
124 klist_node_init(k, n); in klist_add_head()
125 add_head(k, n); in klist_add_head()
134 void klist_add_tail(struct klist_node *n, struct klist *k) in klist_add_tail() argument
136 klist_node_init(k, n); in klist_add_tail()
137 add_tail(k, n); in klist_add_tail()
146 void klist_add_behind(struct klist_node *n, struct klist_node *pos) in klist_add_behind() argument
150 klist_node_init(k, n); in klist_add_behind()
152 list_add(&n->n_node, &pos->n_node); in klist_add_behind()
162 void klist_add_before(struct klist_node *n, struct klist_node *pos) in klist_add_before() argument
166 klist_node_init(k, n); in klist_add_before()
168 list_add_tail(&n->n_node, &pos->n_node); in klist_add_before()
186 struct klist_node *n = container_of(kref, struct klist_node, n_ref); in klist_release() local
188 WARN_ON(!knode_dead(n)); in klist_release()
189 list_del(&n->n_node); in klist_release()
192 if (waiter->node != n) in klist_release()
201 knode_set_klist(n, NULL); in klist_release()
204 static int klist_dec_and_del(struct klist_node *n) in klist_dec_and_del() argument
206 return kref_put(&n->n_ref, klist_release); in klist_dec_and_del()
209 static void klist_put(struct klist_node *n, bool kill) in klist_put() argument
211 struct klist *k = knode_klist(n); in klist_put()
216 knode_kill(n); in klist_put()
217 if (!klist_dec_and_del(n)) in klist_put()
221 put(n); in klist_put()
228 void klist_del(struct klist_node *n) in klist_del() argument
230 klist_put(n, true); in klist_del()
238 void klist_remove(struct klist_node *n) in klist_remove() argument
242 waiter.node = n; in klist_remove()
249 klist_del(n); in klist_remove()
265 int klist_node_attached(struct klist_node *n) in klist_node_attached() argument
267 return (n->n_klist != NULL); in klist_node_attached()
281 struct klist_node *n) in klist_iter_init_node() argument
285 if (n && kref_get_unless_zero(&n->n_ref)) in klist_iter_init_node()
286 i->i_cur = n; in klist_iter_init_node()
320 static struct klist_node *to_klist_node(struct list_head *n) in to_klist_node() argument
322 return container_of(n, struct klist_node, n_node); in to_klist_node()