xfs
[Top] [All Lists]

Re: Compile problem...undefined reference to `xfs_params'

To: Scott Jepson <scott@xxxxxxxx>
Subject: Re: Compile problem...undefined reference to `xfs_params'
From: Keith Owens <kaos@xxxxxxx>
Date: Thu, 20 Feb 2003 12:47:27 +1100
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: Your message of "Wed, 19 Feb 2003 17:00:43 -0800." <Pine.SGI.4.44.0302191649540.19121-100000@oz.cnes.com>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Wed, 19 Feb 2003 17:00:43 -0800, 
Scott Jepson <scott@xxxxxxxx> wrote:
>Has anyone seen or fixed this problem?:
>fs/fs.o: In function `xfs_cmn_err':
>fs/fs.o(.text+0x6a172): undefined reference to `xfs_params'

XFS did not build with CONFIG_SYSCTL=n.

diff fs/xfs/linux/Makefile
--- fs/xfs/linux/Makefile
+++ fs/xfs/linux/Makefile
@@ -49,9 +49,9 @@
 export-objs                    := xfs_globals.o
 
 obj-$(CONFIG_PROC_FS)          += xfs_stats.o
-obj-$(CONFIG_SYSCTL)           += xfs_sysctl.o
 
-obj-y                          += xfs_aops.o \
+obj-y                          += xfs_sysctl.o \
+                                  xfs_aops.o \
                                   xfs_behavior.o \
                                   xfs_file.o \
                                   xfs_fs_subr.o \

diff fs/xfs/linux/xfs_sysctl.c
--- fs/xfs/linux/xfs_sysctl.c
+++ fs/xfs/linux/xfs_sysctl.c
@@ -35,9 +35,13 @@
 #include <linux/proc_fs.h>
 
 /*
- * Tunable XFS parameters
+ * Tunable XFS parameters.  xfs_params is required even when CONFIG_SYSCTL=n,
+ * other XFS code uses these values.
  */
 
+xfs_param_t xfs_params = { 128, 32, 0, 1, 0, 0, 0 };
+
+#ifdef CONFIG_SYSCTL
 extern struct xfsstats xfsstats;
 
 STATIC ulong xfs_min[XFS_PARAM] = { \
@@ -45,8 +49,6 @@
 STATIC ulong xfs_max[XFS_PARAM] = { \
        XFS_REFCACHE_SIZE_MAX,  XFS_REFCACHE_SIZE_MAX, 1, 1, 1, 1, 127 };
 
-xfs_param_t xfs_params = { 128, 32, 0, 1, 0, 0, 0 };
-
 static struct ctl_table_header *xfs_table_header;
 
 
@@ -143,16 +145,21 @@
        {CTL_FS, "fs",  NULL, 0, 0555, xfs_dir_table},
        {0}
 };
+#endif /* CONFIG_SYSCTL */
 
 void
 xfs_sysctl_register(void)
 {
+#ifdef CONFIG_SYSCTL
        xfs_table_header = register_sysctl_table(xfs_root_table, 1);
+#endif
 }
 
 void
 xfs_sysctl_unregister(void)
 {
+#ifdef CONFIG_SYSCTL
        if (xfs_table_header)
                unregister_sysctl_table(xfs_table_header);
+#endif
 }

diff fs/xfs/linux/xfs_sysctl.h
--- fs/xfs/linux/xfs_sysctl.h
+++ fs/xfs/linux/xfs_sysctl.h
@@ -64,12 +64,7 @@
 
 extern xfs_param_t     xfs_params;
 
-#ifdef CONFIG_SYSCTL
 extern void xfs_sysctl_register(void);
 extern void xfs_sysctl_unregister(void);
-#else
-static __inline void xfs_sysctl_register(void) { };
-static __inline void xfs_sysctl_unregister(void) { };
-#endif
 
 #endif /* __XFS_SYSCTL_H__ */


<Prev in Thread] Current Thread [Next in Thread>