Skip to contentSkip to conversation

Second round of ioctl cleanups

PATCH In review Matthew Wilcox 5 participants 7 messages Oct 7, 2002 – Oct 9, 2002 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Second round of ioctl cleanups

- decnet: we should always call the device for unknown ioctls.
- move dlci, bridging, vlan and divert ioctls from af_inet.c to net/socket.c.
- remove duplicate code from af_packet.c and af_wanpipe.c.
- remove kmod from af_inet.c; no longer needed.
- no longer export divert_ioctl; it's not used from a module.
- don't depend on CONFIG_*_MODULE so we can just add these later as modules without forcing a kernel recompile. total cost: 3 * sizeof(void *) in bss.
- remove the WIRELESS_EXT conditional; always compiling this in costs almost nothing.

net/decnet/af_decnet.c +4 -4
diff -urpNX dontdiff linux-2.5.41/net/decnet/af_decnet.c linux-2.5.41-willy/net/decnet/af_decnet.c
@@ -1227,10 +1227,6 @@ static int dn_ioctl(struct socket *sock,
 	case OSIOCGNETADDR:
 		err = put_user(decnet_address, (unsigned short *)arg);
 		break;
-        case SIOCGIFCONF:
-        case SIOCGIFFLAGS:
-        case SIOCGIFBRDADDR:
-                return dev_ioctl(cmd,(void *)arg);
 
 	case TIOCOUTQ:
 		amount = sk->sndbuf - atomic_read(&sk->wmem_alloc);
@@ -1255,6 +1251,10 @@ static int dn_ioctl(struct socket *sock,
 		release_sock(sk);
 		err = put_user(amount, (int *)arg);
 		break;
+
+	default:
+		err = dev_ioctl(cmd,(void *)arg);
+		break;
 	}
 
 	return err;
net/ipv4/af_inet.c +0 -79

106 lines not on this page · raw message

net/netsyms.c +2 -5
diff -urpNX dontdiff linux-2.5.41/net/netsyms.c linux-2.5.41-willy/net/netsyms.c
@@ -220,8 +220,8 @@ EXPORT_SYMBOL(destroy_EII_client);
 /* for 801q VLAN support */
 #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
 EXPORT_SYMBOL(dev_change_flags);
-EXPORT_SYMBOL(vlan_ioctl_hook);
 #endif
+EXPORT_SYMBOL(vlan_ioctl_hook);
 
 EXPORT_SYMBOL(sklist_destroy_socket);
 EXPORT_SYMBOL(sklist_insert_socket);
@@ -230,15 +230,12 @@ EXPORT_SYMBOL(scm_detach_fds);
 
 #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
 EXPORT_SYMBOL(br_handle_frame_hook);
-#ifdef CONFIG_INET
-EXPORT_SYMBOL(br_ioctl_hook);
-#endif
 #endif
+EXPORT_SYMBOL(br_ioctl_hook);
 
 #ifdef CONFIG_NET_DIVERT
 EXPORT_SYMBOL(alloc_divert_blk);
 EXPORT_SYMBOL(free_divert_blk);
-EXPORT_SYMBOL(divert_ioctl);
 #endif /* CONFIG_NET_DIVERT */
 
 #ifdef CONFIG_INET
net/packet/af_packet.c +0 -33
diff -urpNX dontdiff linux-2.5.41/net/packet/af_packet.c linux-2.5.41-willy/net/packet/af_packet.c
@@ -67,20 +67,11 @@
 #include <linux/poll.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/if_bridge.h>
-
-#ifdef CONFIG_NET_DIVERT
-#include <linux/divert.h>
-#endif /* CONFIG_NET_DIVERT */
 
 #ifdef CONFIG_INET
 #include <net/inet_common.h>
 #endif
 
-#ifdef CONFIG_DLCI
-extern int dlci_ioctl(unsigned int, void*);
-#endif
-
 #define CONFIG_SOCK_PACKET	1
 
 /*
@@ -1489,28 +1480,6 @@ static int packet_ioctl(struct socket *s
 		case SIOCSIFHWBROADCAST:
 			return(dev_ioctl(cmd,(void *) arg));
 
-		case SIOCGIFBR:
-		case SIOCSIFBR:
-#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-#ifdef CONFIG_INET
-#ifdef CONFIG_KMOD
-			if (br_ioctl_hook == NULL)
-				request_module("bridge");
-#endif
-			if (br_ioctl_hook != NULL)
-				return br_ioctl_hook(arg);
-#endif
-#endif				
-			return -ENOPKG;
-
-		case SIOCGIFDIVERT:
-		case SIOCSIFDIVERT:
-#ifdef CONFIG_NET_DIVERT
-			return divert_ioctl(cmd, (struct divert_cf *) arg);
-#else
-			return -ENOPKG;
-#endif /* CONFIG_NET_DIVERT */
-			
 #ifdef CONFIG_INET
 		case SIOCADDRT:
 		case SIOCDELRT:
@@ -1526,8 +1495,6 @@ static int packet_ioctl(struct socket *s
 		case SIOCGIFDSTADDR:
 		case SIOCSIFDSTADDR:
 		case SIOCSIFFLAGS:
-		case SIOCADDDLCI:
-		case SIOCDELDLCI:
 			return inet_dgram_ops.ioctl(sock, cmd, arg);
 #endif
 
net/socket.c +63 -6

94 lines not on this page · raw message

net/wanrouter/af_wanpipe.c +0 -2
diff -urpNX dontdiff linux-2.5.41/net/wanrouter/af_wanpipe.c linux-2.5.41-willy/net/wanrouter/af_wanpipe.c
@@ -1963,8 +1963,6 @@ static int wanpipe_ioctl(struct socket *
 		case SIOCGIFDSTADDR:
 		case SIOCSIFDSTADDR:
 		case SIOCSIFFLAGS:
-		case SIOCADDDLCI:
-		case SIOCDELDLCI:
 			return inet_dgram_ops.ioctl(sock, cmd, arg);
 #endif
 
Signature · 1 line
Revolutions do not require corporate support.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 5 lines · David S. Miller

This patch is ok _except_ you cannot remove contribution credits at the top of a file just because you deleted the whole of what they had fixed in the past.

Please redo this patch without those changes, thanks.

would it be ok to move these credits to net/socket.c? it shows false positives when grepping otherwise.

Signature · 1 line
Revolutions do not require corporate support.
#3 lore raw

From: Matthew Wilcox <[email protected]>
Date: Wed, 9 Oct 2002 13:33:37 +0100

would it be ok to move these credits to net/socket.c? it shows false positives when grepping otherwise.

No, look we still get to mention "invalidate()" in mm/memory.c, we can keep ancient "not accurate at all today" reminders of our past in the networking too.

It's just too rude to move the credits after they've been there all this time.

If at some point we move all of the credits to some master log somewhere, that might be something we could do, but that's like 2.7.x I guess :-)

#4 lore raw
Quoted 4 lines · David S. Miller

If at some point we move all of the credits to some master log somewhere, that might be something we could do, but that's like 2.7.x I guess :-)

I had a bit of a head-scratch over this when tidying up the comment block at the top of fs/buffer.c. Precisely zero of those attributions refer to code which exists any more!

Maybe we should do something like:

* Contributions by:
* John Doe (12/95)
* ...

#5 lore raw
Quoted 4 lines · Andrew Morton

Maybe we should do something like:

* Contributions by:
* John Doe (12/95)

Can I suggest "Gonetributions" ?

Such a file would be good, but it perhaps belongs in one central place rather than cluttering up the entire source tree. Certainly I have no problems with my Gonetributions in the networking vanishing into

Documentation/historical-changes

or somesuch

#6 lore raw
Quoted 6 lines · Alan Cox
Quoted 4 lines · Andrew Morton

Maybe we should do something like:

* Contributions by:
* John Doe (12/95)

Quoted 7 lines

Can I suggest "Gonetributions" ?

Such a file would be good, but it perhaps belongs in one central place rather than cluttering up the entire source tree. Certainly I have no problems with my Gonetributions in the networking vanishing into

Documentation/historical-changes

Or alternately they could just be filed in www.kernel.org/pub/kernel/* and Google?

Signature · 1 line
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.."