public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peng Tao <bergwolf@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Peng Tao <bergwolf@gmail.com>,
	Andreas Dilger <andreas.dilger@intel.com>
Subject: [PATCH 8/9] staging/lustre: fix undefined reference if CONFIG_PROC_FS is off
Date: Tue,  3 Dec 2013 22:42:07 +0800	[thread overview]
Message-ID: <1386081729-9481-11-git-send-email-bergwolf@gmail.com> (raw)
In-Reply-To: <1386081729-9481-1-git-send-email-bergwolf@gmail.com>

When building Lustre with CONFIG_PROC_FS off, we'll get many errors like:

drivers/staging/lustre/lustre/obdclass/llog_test.c:1053: error: implicit declaration of function ‘lprocfs_llog_test_init_vars’
make[3]: *** [drivers/staging/lustre/lustre/obdclass/llog_test.o] Error 1
make[2]: *** [drivers/staging/lustre/lustre/obdclass] Error 2
make[2]: *** Waiting for unfinished jobs....
  CC [M]  drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.o
drivers/staging/lustre/lustre/ptlrpc/pinger.c: In function ‘ptlrpc_pinger_main’:
drivers/staging/lustre/lustre/ptlrpc/pinger.c:331: error: implicit declaration of function ‘obd_update_maxusage’

The patch defines following symbols when CONFIG_PROC_FS is off:
fld_type_proc_dir, obd_update_maxusage(), obd_max_pages, obd_max_alloc, obd_alloc,
obd_pages, lprocfs_llog_test_init_vars().

Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
---
 drivers/staging/lustre/lustre/fld/fld_internal.h   |    1 -
 drivers/staging/lustre/lustre/fld/fld_request.c    |    2 +-
 .../staging/lustre/lustre/include/obd_support.h    |    3 ++-
 drivers/staging/lustre/lustre/obdclass/class_obd.c |    6 ++++++
 drivers/staging/lustre/lustre/obdclass/llog_test.c |    4 ++++
 5 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h b/drivers/staging/lustre/lustre/fld/fld_internal.h
index 56686b1..5f3935c 100644
--- a/drivers/staging/lustre/lustre/fld/fld_internal.h
+++ b/drivers/staging/lustre/lustre/fld/fld_internal.h
@@ -190,5 +190,4 @@ fld_target_name(struct lu_fld_target *tar)
 	return (const char *)tar->ft_exp->exp_obd->obd_name;
 }
 
-extern struct proc_dir_entry *fld_type_proc_dir;
 #endif /* __FLD_INTERNAL_H */
diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c b/drivers/staging/lustre/lustre/fld/fld_request.c
index 3191a39..896f9fe 100644
--- a/drivers/staging/lustre/lustre/fld/fld_request.c
+++ b/drivers/staging/lustre/lustre/fld/fld_request.c
@@ -274,9 +274,9 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 idx)
 }
 EXPORT_SYMBOL(fld_client_del_target);
 
-#ifdef LPROCFS
 struct proc_dir_entry *fld_type_proc_dir = NULL;
 
+#ifdef LPROCFS
 static int fld_client_proc_init(struct lu_client_fld *fld)
 {
 	int rc;
diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h
index 2dc95de..977bc23 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -507,6 +507,8 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,
 
 extern atomic_t libcfs_kmemory;
 
+extern void obd_update_maxusage(void);
+
 #ifdef LPROCFS
 #define obd_memory_add(size)						  \
 	lprocfs_counter_add(obd_memory, OBD_MEMORY_STAT, (long)(size))
@@ -525,7 +527,6 @@ extern atomic_t libcfs_kmemory;
 	lprocfs_stats_collector(obd_memory, OBD_MEMORY_PAGES_STAT,	    \
 				LPROCFS_FIELDS_FLAGS_SUM)
 
-extern void obd_update_maxusage(void);
 extern __u64 obd_memory_max(void);
 extern __u64 obd_pages_max(void);
 
diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c
index 7b1d1b6..5f8d9f2 100644
--- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
+++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
@@ -54,7 +54,13 @@ struct list_head obd_types;
 DEFINE_RWLOCK(obd_dev_lock);
 
 __u64 obd_max_pages = 0;
+EXPORT_SYMBOL(obd_max_pages);
 __u64 obd_max_alloc = 0;
+EXPORT_SYMBOL(obd_max_alloc);
+__u64 obd_alloc;
+EXPORT_SYMBOL(obd_alloc);
+__u64 obd_pages;
+EXPORT_SYMBOL(obd_pages);
 DEFINE_SPINLOCK(obd_updatemax_lock);
 
 /* The following are visible and mutable through /proc/sys/lustre/. */
diff --git a/drivers/staging/lustre/lustre/obdclass/llog_test.c b/drivers/staging/lustre/lustre/obdclass/llog_test.c
index 7427c12..764068f 100644
--- a/drivers/staging/lustre/lustre/obdclass/llog_test.c
+++ b/drivers/staging/lustre/lustre/obdclass/llog_test.c
@@ -947,6 +947,10 @@ static void lprocfs_llog_test_init_vars(struct lprocfs_static_vars *lvars)
     lvars->module_vars  = lprocfs_llog_test_module_vars;
     lvars->obd_vars     = lprocfs_llog_test_obd_vars;
 }
+#else
+static void lprocfs_llog_test_init_vars(struct lprocfs_static_vars *lvars)
+{
+}
 #endif
 
 static int llog_test_cleanup(struct obd_device *obd)
-- 
1.7.9.5


  parent reply	other threads:[~2013-12-03 14:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 14:41 [PATCH 0/9] staging/lustre: minor cleanups and CONFIG_PROC_FS fix up Peng Tao
2013-12-03 14:41 ` [PATCH 1/9] staging/lustre/obdclass: fix false used uninitialized warning Peng Tao
2013-12-03 14:41 ` [PATCH 2/9] staging/lustre/obdclass: lprocfs_{alloc_stats,register} always defined Peng Tao
2013-12-03 14:42 ` Peng Tao
2013-12-03 14:42 ` [PATCH 3/9] staging/lustre/ldlm: inline ldlm_proc_setup Peng Tao
2013-12-03 14:42 ` [PATCH 4/9] staging/lustre/obdclass: move obd_sysctl_init out of class_procfs_init Peng Tao
2013-12-03 14:42 ` Peng Tao
2013-12-03 14:42 ` [PATCH 5/9] staging/lustre: fix defined not used warning Peng Tao
2013-12-03 14:42 ` [PATCH 6/9] staging/lustre/llite: fix used uninitialized warning Peng Tao
2013-12-03 14:42 ` [PATCH 7/9] staging/lustre/llite: remove ll_file_get_iov_count Peng Tao
2013-12-03 17:00   ` Greg Kroah-Hartman
2013-12-03 17:26     ` Peng Tao
2013-12-03 14:42 ` Peng Tao [this message]
2013-12-03 14:42 ` [PATCH 8/9] staging/lustre: fix undefined reference if CONFIG_PROC_FS is off Peng Tao
2013-12-03 14:42 ` [PATCH 9/9] staging/lustre: don't compile procfs code when " Peng Tao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386081729-9481-11-git-send-email-bergwolf@gmail.com \
    --to=bergwolf@gmail.com \
    --cc=andreas.dilger@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox