Skip to contentSkip to conversation

Fix a build warning about leaking CONFIG_NFSD to userspace.

PATCH Applied Greg Banks 2 participants 2 messages Mar 26, 2009 – Mar 27, 2009

Subsystems (2)
lore
Share & tools
lore

Greg Banks

author
#0 lore raw

PATCH 1/1 Fix a build warning about leaking CONFIG_NFSD to userspace.

Fix a build warning about leaking CONFIG_NFSD to userspace.

The nfsd_stats data structure does not need to be available to userspace; no kernel interface uses it. So move it inside #ifdef __KERNEL__ and the warning goes away.

---

 include/linux/nfsd/stats.h |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
include/linux/nfsd/stats.h +5 -4
Index: bfields/include/linux/nfsd/stats.h
===================================================================
@@ -11,6 +11,11 @@
 
 #include <linux/nfs4.h>
 
+/* thread usage wraps very million seconds (approx one fortnight) */
+#define	NFSD_USAGE_WRAP	(HZ*1000000)
+
+#ifdef __KERNEL__
+
 struct nfsd_stats {
 	unsigned int	rchits;		/* repcache hits */
 	unsigned int	rcmisses;	/* repcache hits */
@@ -35,10 +40,6 @@ struct nfsd_stats {
 
 };
 
-/* thread usage wraps very million seconds (approx one fortnight) */
-#define	NFSD_USAGE_WRAP	(HZ*1000000)
-
-#ifdef __KERNEL__
 
 extern struct nfsd_stats	nfsdstats;
 extern struct svc_stat		nfsd_svcstats;
Signature · 3 lines
Greg Banks, P.Engineer, SGI Australian Software Group.
the brightly coloured sporks of revolution.
I don't speak for SGI.
#1 lore raw
Quoted 7 lines · Greg Banks

Fix a build warning about leaking CONFIG_NFSD to userspace.

The nfsd_stats data structure does not need to be available to userspace; no kernel interface uses it. So move it inside #ifdef __KERNEL__ and the warning goes away.

Thanks, applied.--b.

Quoted 39 lines

---

 include/linux/nfsd/stats.h |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Index: bfields/include/linux/nfsd/stats.h
===================================================================

include/linux/nfsd/stats.h +5 -4
@@ -11,6 +11,11 @@
 
 #include <linux/nfs4.h>
 
+/* thread usage wraps very million seconds (approx one fortnight) */
+#define	NFSD_USAGE_WRAP	(HZ*1000000)
+
+#ifdef __KERNEL__
+
 struct nfsd_stats {
 	unsigned int	rchits;		/* repcache hits */
 	unsigned int	rcmisses;	/* repcache hits */
@@ -35,10 +40,6 @@ struct nfsd_stats {
 
 };
 
-/* thread usage wraps very million seconds (approx one fortnight) */
-#define	NFSD_USAGE_WRAP	(HZ*1000000)
-
-#ifdef __KERNEL__
 
 extern struct nfsd_stats	nfsdstats;
 extern struct svc_stat		nfsd_svcstats;
Signature · 4 lines
-- 
Greg Banks, P.Engineer, SGI Australian Software Group.
the brightly coloured sporks of revolution.
I don't speak for SGI.