[-mm patch] fix nfs PROC_FS=n compile error

From: Adrian Bunk
Date: Sun Mar 26 2006 - 07:22:53 EST


On Thu, Mar 23, 2006 at 01:40:46AM -0800, Andrew Morton wrote:
>...
> Boilerplate:
>...
> Changes since 2.6.16-rc6-mm2:
>...
> git-nfs.patch
>...
> git trees.
>...


This patch fixes the following compile error with CONFIG_PROC_FS=n:

<-- snip -->

...
LD .tmp_vmlinux1
fs/built-in.o: In function `nfs_show_stats':inode.c:(.text+0x15481a): undefined reference to `rpc_print_iostats'
net/built-in.o: In function `rpc_destroy_client': undefined reference to `rpc_free_iostats'
net/built-in.o: In function `rpc_clone_client': undefined reference to `rpc_alloc_iostats'
net/built-in.o: In function `rpc_new_client': undefined reference to `rpc_alloc_iostats'
net/built-in.o: In function `xprt_release': undefined reference to `rpc_count_iostats'
make: *** [.tmp_vmlinux1] Error 1

<-- snip -->

Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>

---

include/linux/sunrpc/metrics.h | 12 ++++++++++++
1 file changed, 12 insertions(+)

--- linux-2.6.16-mm1-full/include/linux/sunrpc/metrics.h.old 2006-03-26 00:05:50.000000000 +0100
+++ linux-2.6.16-mm1-full/include/linux/sunrpc/metrics.h 2006-03-26 00:13:46.000000000 +0100
@@ -69,9 +69,21 @@
/*
* EXPORTed functions for managing rpc_iostats structures
*/
+
+#ifdef CONFIG_PROC_FS
+
struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *);
void rpc_count_iostats(struct rpc_task *);
void rpc_print_iostats(struct seq_file *, struct rpc_clnt *);
void rpc_free_iostats(struct rpc_iostats *);

+#else /* CONFIG_PROC_FS */
+
+static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; }
+static inline void rpc_count_iostats(struct rpc_task *task) {}
+static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {}
+static inline void rpc_free_iostats(struct rpc_iostats *stats) {}
+
+#endif /* CONFIG_PROC_FS */
+
#endif /* _LINUX_SUNRPC_METRICS_H */

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