Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * 	atalk_proc.c - proc support for Appletalk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * 	Copyright(c) Arnaldo Carvalho de Melo <acme@conectiva.com.br>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/proc_fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/seq_file.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <net/net_namespace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <net/sock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/atalk.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/export.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) static __inline__ struct atalk_iface *atalk_get_interface_idx(loff_t pos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	struct atalk_iface *i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	for (i = atalk_interfaces; pos && i; i = i->next)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 		--pos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	return i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) static void *atalk_seq_interface_start(struct seq_file *seq, loff_t *pos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	__acquires(atalk_interfaces_lock)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	loff_t l = *pos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	read_lock_bh(&atalk_interfaces_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	return l ? atalk_get_interface_idx(--l) : SEQ_START_TOKEN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) static void *atalk_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	struct atalk_iface *i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	++*pos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	if (v == SEQ_START_TOKEN) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 		i = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 		if (atalk_interfaces)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 			i = atalk_interfaces;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	i = v;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	i = i->next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	return i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) static void atalk_seq_interface_stop(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	__releases(atalk_interfaces_lock)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	read_unlock_bh(&atalk_interfaces_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) static int atalk_seq_interface_show(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	struct atalk_iface *iface;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	if (v == SEQ_START_TOKEN) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		seq_puts(seq, "Interface        Address   Networks  "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 			      "Status\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	iface = v;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	seq_printf(seq, "%-16s %04X:%02X  %04X-%04X  %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		   iface->dev->name, ntohs(iface->address.s_net),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 		   iface->address.s_node, ntohs(iface->nets.nr_firstnet),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		   ntohs(iface->nets.nr_lastnet), iface->status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) static __inline__ struct atalk_route *atalk_get_route_idx(loff_t pos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	struct atalk_route *r;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	for (r = atalk_routes; pos && r; r = r->next)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 		--pos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	return r;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) static void *atalk_seq_route_start(struct seq_file *seq, loff_t *pos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	__acquires(atalk_routes_lock)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	loff_t l = *pos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	read_lock_bh(&atalk_routes_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	return l ? atalk_get_route_idx(--l) : SEQ_START_TOKEN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) static void *atalk_seq_route_next(struct seq_file *seq, void *v, loff_t *pos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	struct atalk_route *r;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	++*pos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	if (v == SEQ_START_TOKEN) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		r = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		if (atalk_routes)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 			r = atalk_routes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	r = v;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	r = r->next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	return r;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) static void atalk_seq_route_stop(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	__releases(atalk_routes_lock)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	read_unlock_bh(&atalk_routes_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) static int atalk_seq_route_show(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	struct atalk_route *rt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	if (v == SEQ_START_TOKEN) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 		seq_puts(seq, "Target        Router  Flags Dev\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	if (atrtr_default.dev) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		rt = &atrtr_default;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 		seq_printf(seq, "Default     %04X:%02X  %-4d  %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 			       ntohs(rt->gateway.s_net), rt->gateway.s_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 			       rt->flags, rt->dev->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	rt = v;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	seq_printf(seq, "%04X:%02X     %04X:%02X  %-4d  %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 		   ntohs(rt->target.s_net), rt->target.s_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		   ntohs(rt->gateway.s_net), rt->gateway.s_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		   rt->flags, rt->dev->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) static void *atalk_seq_socket_start(struct seq_file *seq, loff_t *pos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	__acquires(atalk_sockets_lock)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	read_lock_bh(&atalk_sockets_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	return seq_hlist_start_head(&atalk_sockets, *pos);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) static void *atalk_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	return seq_hlist_next(v, &atalk_sockets, pos);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) static void atalk_seq_socket_stop(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	__releases(atalk_sockets_lock)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	read_unlock_bh(&atalk_sockets_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) static int atalk_seq_socket_show(struct seq_file *seq, void *v)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	struct sock *s;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	struct atalk_sock *at;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	if (v == SEQ_START_TOKEN) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 		seq_printf(seq, "Type Local_addr  Remote_addr Tx_queue "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 				"Rx_queue St UID\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	s = sk_entry(v);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	at = at_sk(s);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	seq_printf(seq, "%02X   %04X:%02X:%02X  %04X:%02X:%02X  %08X:%08X "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 			"%02X %u\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 		   s->sk_type, ntohs(at->src_net), at->src_node, at->src_port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 		   ntohs(at->dest_net), at->dest_node, at->dest_port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		   sk_wmem_alloc_get(s),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		   sk_rmem_alloc_get(s),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		   s->sk_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		   from_kuid_munged(seq_user_ns(seq), sock_i_uid(s)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) static const struct seq_operations atalk_seq_interface_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	.start  = atalk_seq_interface_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	.next   = atalk_seq_interface_next,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	.stop   = atalk_seq_interface_stop,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	.show   = atalk_seq_interface_show,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) static const struct seq_operations atalk_seq_route_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	.start  = atalk_seq_route_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	.next   = atalk_seq_route_next,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	.stop   = atalk_seq_route_stop,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	.show   = atalk_seq_route_show,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) static const struct seq_operations atalk_seq_socket_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	.start  = atalk_seq_socket_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	.next   = atalk_seq_socket_next,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	.stop   = atalk_seq_socket_stop,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	.show   = atalk_seq_socket_show,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) int __init atalk_proc_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 	if (!proc_mkdir("atalk", init_net.proc_net))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 		return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	if (!proc_create_seq("atalk/interface", 0444, init_net.proc_net,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 			    &atalk_seq_interface_ops))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	if (!proc_create_seq("atalk/route", 0444, init_net.proc_net,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 			    &atalk_seq_route_ops))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	if (!proc_create_seq("atalk/socket", 0444, init_net.proc_net,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 			    &atalk_seq_socket_ops))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	if (!proc_create_seq_private("atalk/arp", 0444, init_net.proc_net,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 				     &aarp_seq_ops,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 				     sizeof(struct aarp_iter_state), NULL))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	remove_proc_subtree("atalk", init_net.proc_net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	return -ENOMEM;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) void atalk_proc_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	remove_proc_subtree("atalk", init_net.proc_net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) }