Commit 9d2834dd authored by Peng Tao's avatar Peng Tao Committed by Greg Kroah-Hartman

staging/lustre: fix undefined reference if CONFIG_PROC_FS is off

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: default avatarPeng Tao <bergwolf@gmail.com>
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 960edbe3
...@@ -190,5 +190,4 @@ fld_target_name(struct lu_fld_target *tar) ...@@ -190,5 +190,4 @@ fld_target_name(struct lu_fld_target *tar)
return (const char *)tar->ft_exp->exp_obd->obd_name; return (const char *)tar->ft_exp->exp_obd->obd_name;
} }
extern struct proc_dir_entry *fld_type_proc_dir;
#endif /* __FLD_INTERNAL_H */ #endif /* __FLD_INTERNAL_H */
...@@ -274,9 +274,9 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 idx) ...@@ -274,9 +274,9 @@ int fld_client_del_target(struct lu_client_fld *fld, __u64 idx)
} }
EXPORT_SYMBOL(fld_client_del_target); EXPORT_SYMBOL(fld_client_del_target);
#ifdef LPROCFS
struct proc_dir_entry *fld_type_proc_dir = NULL; struct proc_dir_entry *fld_type_proc_dir = NULL;
#ifdef LPROCFS
static int fld_client_proc_init(struct lu_client_fld *fld) static int fld_client_proc_init(struct lu_client_fld *fld)
{ {
int rc; int rc;
......
...@@ -507,6 +507,8 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, ...@@ -507,6 +507,8 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,
extern atomic_t libcfs_kmemory; extern atomic_t libcfs_kmemory;
extern void obd_update_maxusage(void);
#ifdef LPROCFS #ifdef LPROCFS
#define obd_memory_add(size) \ #define obd_memory_add(size) \
lprocfs_counter_add(obd_memory, OBD_MEMORY_STAT, (long)(size)) lprocfs_counter_add(obd_memory, OBD_MEMORY_STAT, (long)(size))
...@@ -525,7 +527,6 @@ extern atomic_t libcfs_kmemory; ...@@ -525,7 +527,6 @@ extern atomic_t libcfs_kmemory;
lprocfs_stats_collector(obd_memory, OBD_MEMORY_PAGES_STAT, \ lprocfs_stats_collector(obd_memory, OBD_MEMORY_PAGES_STAT, \
LPROCFS_FIELDS_FLAGS_SUM) LPROCFS_FIELDS_FLAGS_SUM)
extern void obd_update_maxusage(void);
extern __u64 obd_memory_max(void); extern __u64 obd_memory_max(void);
extern __u64 obd_pages_max(void); extern __u64 obd_pages_max(void);
......
...@@ -54,7 +54,13 @@ struct list_head obd_types; ...@@ -54,7 +54,13 @@ struct list_head obd_types;
DEFINE_RWLOCK(obd_dev_lock); DEFINE_RWLOCK(obd_dev_lock);
__u64 obd_max_pages = 0; __u64 obd_max_pages = 0;
EXPORT_SYMBOL(obd_max_pages);
__u64 obd_max_alloc = 0; __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); DEFINE_SPINLOCK(obd_updatemax_lock);
/* The following are visible and mutable through /proc/sys/lustre/. */ /* The following are visible and mutable through /proc/sys/lustre/. */
......
...@@ -947,6 +947,10 @@ static void lprocfs_llog_test_init_vars(struct lprocfs_static_vars *lvars) ...@@ -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->module_vars = lprocfs_llog_test_module_vars;
lvars->obd_vars = lprocfs_llog_test_obd_vars; lvars->obd_vars = lprocfs_llog_test_obd_vars;
} }
#else
static void lprocfs_llog_test_init_vars(struct lprocfs_static_vars *lvars)
{
}
#endif #endif
static int llog_test_cleanup(struct obd_device *obd) static int llog_test_cleanup(struct obd_device *obd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment