126 }
127 if (ax25_uid == NULL) {
128 write_unlock(&ax25_uid_lock);
129 return -ENOENT;
130 }
131 hlist_del_init(&ax25_uid->uid_node);
132 ax25_uid_put(ax25_uid);
133 write_unlock(&ax25_uid_lock);
134
135 return 0;
136
137 default:
138 return -EINVAL;
139 }
140
141 return -EINVAL;
142}
143
144#ifdef CONFIG_PROC_FS
145
146static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos)
147 __acquires(ax25_uid_lock)
148{
149 struct ax25_uid_assoc *pt;
150 struct hlist_node *node;
151 int i = 0;
152
153 read_lock(&ax25_uid_lock);
154 ax25_uid_for_each(pt, node, &ax25_uid_list) {
155 if (i == *pos)
156 return pt;
157 ++i;
158 }
159 return NULL;
160}
161
162static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos)
163{
164 ++*pos;
165
166 return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next,