[PATCH]: A few space savings in net/sunrpc

From: Graham Stoney (greyham@research.canon.com.au)
Date: Thu Apr 13 2000 - 02:03:06 EST


Hi gang,

The following patch saves some otherwise wasted space down in net/sunrpc,
especially if you're not doing RPC_DEBUG or CONFIG_SYSCTL. It should apply
against 2.2.14 and 2.3.99-pre3 (except for the last hunk, which isn't needed
in 2.3). Enjoy!

Index: net/sunrpc/Makefile
===================================================================
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile
--- net/sunrpc/Makefile 1999/12/30 06:01:42 1.1.1.1
+++ net/sunrpc/Makefile 2000/03/30 03:36:27
@@ -11,11 +11,15 @@
 O_OBJS := clnt.o xprt.o sched.o \
             auth.o auth_null.o auth_unix.o \
             svc.o svcsock.o svcauth.o \
- pmap_clnt.o xdr.o sysctl.o
+ pmap_clnt.o xdr.o
 OX_OBJS := sunrpc_syms.o
 
 ifeq ($(CONFIG_PROC_FS),y)
   O_OBJS += stats.o
+endif
+
+ifeq ($(CONFIG_SYSCTL),y)
+ O_OBJS += sysctl.o
 endif
 
 M_OBJS := $(O_TARGET)
Index: net/sunrpc/sched.c
===================================================================
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 sched.c
--- net/sunrpc/sched.c 1999/12/30 06:01:42 1.1.1.1
+++ net/sunrpc/sched.c 2000/03/30 03:15:39
@@ -830,7 +830,7 @@
 
         current->session = 1;
         current->pgrp = 1;
- sprintf(current->comm, "rpciod");
+ strcpy(current->comm, "rpciod");
 
         dprintk("RPC: rpciod starting (pid %d)\n", rpciod_pid);
         while (rpciod_users) {
Index: net/sunrpc/sunrpc_syms.c
===================================================================
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 sunrpc_syms.c
--- net/sunrpc/sunrpc_syms.c 1999/12/30 06:01:42 1.1.1.1
+++ net/sunrpc/sunrpc_syms.c 2000/03/30 03:43:56
@@ -100,7 +100,9 @@
 EXPORT_SYMBOL(rpc_system_err);
 
 /* Debugging symbols */
+#ifdef RPC_DEBUG
 EXPORT_SYMBOL(rpc_debug);
 EXPORT_SYMBOL(nfs_debug);
 EXPORT_SYMBOL(nfsd_debug);
 EXPORT_SYMBOL(nlm_debug);
+#endif
Index: net/sunrpc/sysctl.c
===================================================================
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 sysctl.c
--- net/sunrpc/sysctl.c 1999/12/30 06:01:42 1.1.1.1
+++ net/sunrpc/sysctl.c 2000/03/30 03:19:16
@@ -57,7 +57,7 @@
         }
 }
 
-int
+static int
 proc_dodebug(ctl_table *table, int write, struct file *file,
                                 void *buffer, size_t *lenp)
 {
Index: net/sunrpc/xprt.c
===================================================================
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 xprt.c
--- net/sunrpc/xprt.c 1999/12/30 06:01:42 1.1.1.1
+++ net/sunrpc/xprt.c 2000/03/30 03:39:42
@@ -1203,7 +1203,9 @@
         printk(KERN_ERR
                 "RPC: %4d inconsistent free list (cong %ld cwnd %ld)\n",
                 task->tk_pid, xprt->cong, xprt->cwnd);
+#ifdef RPC_DEBUG
         rpc_debug = ~0;
+#endif
         goto bummer;
 bad_used:
         printk(KERN_ERR "RPC: used rqst slot %p on free list!\n", req);

-- 
Graham Stoney
Principal Hardware/Software Engineer
Canon Information Systems Research Australia
Ph: +61 2 9805 2909  Fax: +61 2 9805 2929

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:20 EST