From: Liu Xuezhao Date: Tue, 10 Jul 2012 13:13:26 +0000 (+0800) Subject: LU-1347 obdclass: makes EXPORT_SYMBOL follows function body X-Git-Tag: 2.2.92~6 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=52257a67e4d56172a4289a12509525154d8c790d LU-1347 obdclass: makes EXPORT_SYMBOL follows function body Makes EXPORT_SYMBOL macros immediately follow the function body, to follow normal Linux kernel coding style. Signed-off-by: Liu Xuezhao Change-Id: I3d1b3ebb244e3d7a069d5be13f893ffee7b5f3dd Reviewed-on: http://review.whamcloud.com/2839 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger --- diff --git a/lustre/obdclass/capa.c b/lustre/obdclass/capa.c index 539910c..b121449 100644 --- a/lustre/obdclass/capa.c +++ b/lustre/obdclass/capa.c @@ -97,6 +97,7 @@ cfs_hlist_head_t *init_capa_hash(void) CFS_INIT_HLIST_HEAD(hash + i); return hash; } +EXPORT_SYMBOL(init_capa_hash); #ifdef __KERNEL__ static inline int capa_on_server(struct obd_capa *ocapa) @@ -130,6 +131,7 @@ void cleanup_capa_hash(cfs_hlist_head_t *hash) OBD_FREE(hash, CFS_PAGE_SIZE); } +EXPORT_SYMBOL(cleanup_capa_hash); static inline int capa_hashfn(struct lu_fid *fid) { @@ -219,6 +221,7 @@ struct obd_capa *capa_add(cfs_hlist_head_t *hash, struct lustre_capa *capa) return old; } } +EXPORT_SYMBOL(capa_add); struct obd_capa *capa_lookup(cfs_hlist_head_t *hash, struct lustre_capa *capa, int alive) @@ -236,6 +239,7 @@ struct obd_capa *capa_lookup(cfs_hlist_head_t *hash, struct lustre_capa *capa, return ocapa; } +EXPORT_SYMBOL(capa_lookup); int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key) { @@ -268,6 +272,7 @@ int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key) return 0; } +EXPORT_SYMBOL(capa_hmac); int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen) { @@ -320,6 +325,7 @@ out: ll_crypto_free_blkcipher(tfm); return rc; } +EXPORT_SYMBOL(capa_encrypt_id); int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen) { @@ -373,6 +379,7 @@ out: ll_crypto_free_blkcipher(tfm); return rc; } +EXPORT_SYMBOL(capa_decrypt_id); #endif void capa_cpy(void *capa, struct obd_capa *ocapa) @@ -381,6 +388,7 @@ void capa_cpy(void *capa, struct obd_capa *ocapa) *(struct lustre_capa *)capa = ocapa->c_capa; cfs_spin_unlock(&ocapa->c_lock); } +EXPORT_SYMBOL(capa_cpy); void _debug_capa(struct lustre_capa *c, struct libcfs_debug_msg_data *msgdata, @@ -398,12 +406,3 @@ void _debug_capa(struct lustre_capa *c, va_end(args); } EXPORT_SYMBOL(_debug_capa); - -EXPORT_SYMBOL(init_capa_hash); -EXPORT_SYMBOL(cleanup_capa_hash); -EXPORT_SYMBOL(capa_add); -EXPORT_SYMBOL(capa_lookup); -EXPORT_SYMBOL(capa_hmac); -EXPORT_SYMBOL(capa_encrypt_id); -EXPORT_SYMBOL(capa_decrypt_id); -EXPORT_SYMBOL(capa_cpy); diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index fcf7cc5..f8c5f9c 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -56,6 +56,7 @@ cfs_atomic_t libcfs_kmemory = {0}; #endif struct obd_device *obd_devs[MAX_OBD_DEVICES]; +EXPORT_SYMBOL(obd_devs); cfs_list_t obd_types; cfs_rwlock_t obd_dev_lock = CFS_RW_LOCK_UNLOCKED; @@ -68,20 +69,33 @@ __u64 obd_pages; /* The following are visible and mutable through /proc/sys/lustre/. */ unsigned int obd_debug_peer_on_timeout; +EXPORT_SYMBOL(obd_debug_peer_on_timeout); unsigned int obd_dump_on_timeout; +EXPORT_SYMBOL(obd_dump_on_timeout); unsigned int obd_dump_on_eviction; +EXPORT_SYMBOL(obd_dump_on_eviction); unsigned int obd_max_dirty_pages = 256; +EXPORT_SYMBOL(obd_max_dirty_pages); +cfs_atomic_t obd_dirty_pages; +EXPORT_SYMBOL(obd_dirty_pages); unsigned int obd_timeout = OBD_TIMEOUT_DEFAULT; /* seconds */ +EXPORT_SYMBOL(obd_timeout); unsigned int ldlm_timeout = LDLM_TIMEOUT_DEFAULT; /* seconds */ +EXPORT_SYMBOL(ldlm_timeout); /* Adaptive timeout defs here instead of ptlrpc module for /proc/sys/ access */ unsigned int at_min = 0; +EXPORT_SYMBOL(at_min); unsigned int at_max = 600; +EXPORT_SYMBOL(at_max); unsigned int at_history = 600; +EXPORT_SYMBOL(at_history); int at_early_margin = 5; +EXPORT_SYMBOL(at_early_margin); int at_extra = 30; +EXPORT_SYMBOL(at_extra); -cfs_atomic_t obd_dirty_pages; cfs_atomic_t obd_dirty_transit_pages; +EXPORT_SYMBOL(obd_dirty_transit_pages); char obd_jobid_var[JOBSTATS_JOBID_VAR_MAX_LEN + 1] = JOBSTATS_DISABLE; EXPORT_SYMBOL(obd_jobid_var); @@ -388,61 +402,12 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) RETURN(err); } /* class_handle_ioctl */ - - #ifdef __KERNEL__ extern cfs_psdev_t obd_psdev; #else void *obd_psdev = NULL; #endif -EXPORT_SYMBOL(obd_devs); -EXPORT_SYMBOL(obd_debug_peer_on_timeout); -EXPORT_SYMBOL(obd_dump_on_timeout); -EXPORT_SYMBOL(obd_dump_on_eviction); -EXPORT_SYMBOL(obd_timeout); -EXPORT_SYMBOL(ldlm_timeout); -EXPORT_SYMBOL(obd_max_dirty_pages); -EXPORT_SYMBOL(obd_dirty_pages); -EXPORT_SYMBOL(obd_dirty_transit_pages); -EXPORT_SYMBOL(at_min); -EXPORT_SYMBOL(at_max); -EXPORT_SYMBOL(at_extra); -EXPORT_SYMBOL(at_early_margin); -EXPORT_SYMBOL(at_history); -EXPORT_SYMBOL(ptlrpc_put_connection_superhack); -EXPORT_SYMBOL(proc_lustre_root); - -/* uuid.c */ -EXPORT_SYMBOL(class_uuid_unparse); -EXPORT_SYMBOL(lustre_uuid_to_peer); - -EXPORT_SYMBOL(class_handle_hash); -EXPORT_SYMBOL(class_handle_unhash); -EXPORT_SYMBOL(class_handle_hash_back); -EXPORT_SYMBOL(class_handle2object); -EXPORT_SYMBOL(class_handle_free_cb); - -/* obd_config.c */ -EXPORT_SYMBOL(class_incref); -EXPORT_SYMBOL(class_decref); -EXPORT_SYMBOL(class_get_profile); -EXPORT_SYMBOL(class_del_profile); -EXPORT_SYMBOL(class_del_profiles); -EXPORT_SYMBOL(class_process_config); -EXPORT_SYMBOL(class_process_proc_param); -EXPORT_SYMBOL(class_config_parse_llog); -EXPORT_SYMBOL(class_config_dump_llog); -EXPORT_SYMBOL(class_attach); -EXPORT_SYMBOL(class_setup); -EXPORT_SYMBOL(class_cleanup); -EXPORT_SYMBOL(class_detach); -EXPORT_SYMBOL(class_manual_cleanup); - -/* mea.c */ -EXPORT_SYMBOL(mea_name2idx); -EXPORT_SYMBOL(raw_name2idx); - #define OBD_INIT_CHECK #ifdef OBD_INIT_CHECK int obd_init_checks(void) diff --git a/lustre/obdclass/debug.c b/lustre/obdclass/debug.c index bbcc306..1c556bb 100644 --- a/lustre/obdclass/debug.c +++ b/lustre/obdclass/debug.c @@ -69,6 +69,7 @@ void dump_lsm(int level, struct lov_stripe_md *lsm) cfs_atomic_read(&lsm->lsm_refc), lsm->lsm_layout_gen, lsm->lsm_pool_name); } +EXPORT_SYMBOL(dump_lsm); #define LPDS sizeof(__u64) int block_debug_setup(void *addr, int len, __u64 off, __u64 id) @@ -86,6 +87,7 @@ int block_debug_setup(void *addr, int len, __u64 off, __u64 id) return 0; } +EXPORT_SYMBOL(block_debug_setup); int block_debug_check(char *who, void *addr, int end, __u64 off, __u64 id) { @@ -121,9 +123,5 @@ int block_debug_check(char *who, void *addr, int end, __u64 off, __u64 id) return err; } -#undef LPDS - -//EXPORT_SYMBOL(dump_req); -EXPORT_SYMBOL(dump_lsm); -EXPORT_SYMBOL(block_debug_setup); EXPORT_SYMBOL(block_debug_check); +#undef LPDS diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index b103fa5..5d2547a 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -65,6 +65,7 @@ static void print_export_data(struct obd_export *exp, const char *status, int locks); int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c); +EXPORT_SYMBOL(ptlrpc_put_connection_superhack); /* * support functions: we could use inter-module communication, but this diff --git a/lustre/obdclass/linux/linux-module.c b/lustre/obdclass/linux/linux-module.c index 6990177..af3fd9a 100644 --- a/lustre/obdclass/linux/linux-module.c +++ b/lustre/obdclass/linux/linux-module.c @@ -159,6 +159,7 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg) EXIT; return 0; } +EXPORT_SYMBOL(obd_ioctl_getdata); int obd_ioctl_popdata(void *arg, void *data, int len) { @@ -169,8 +170,6 @@ int obd_ioctl_popdata(void *arg, void *data, int len) err = -EFAULT; return err; } - -EXPORT_SYMBOL(obd_ioctl_getdata); EXPORT_SYMBOL(obd_ioctl_popdata); /* opening /dev/obd */ @@ -325,6 +324,7 @@ static int obd_proc_wr_jobid_var(struct file *file, const char *buffer, /* Root for /proc/fs/lustre */ struct proc_dir_entry *proc_lustre_root = NULL; +EXPORT_SYMBOL(proc_lustre_root); struct lprocfs_vars lprocfs_base[] = { { "version", obd_proc_read_version, NULL, NULL }, diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index cca78bc..cf41921 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -99,6 +99,7 @@ struct proc_dir_entry *lprocfs_srch(struct proc_dir_entry *head, LPROCFS_SRCH_EXIT(); return temp; } +EXPORT_SYMBOL(lprocfs_srch); /* lprocfs API calls */ @@ -156,6 +157,7 @@ cfs_proc_dir_entry_t *lprocfs_add_simple(struct proc_dir_entry *root, LPROCFS_WRITE_EXIT(); return proc; } +EXPORT_SYMBOL(lprocfs_add_simple); struct proc_dir_entry *lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent, const char *format, ...) @@ -183,6 +185,7 @@ struct proc_dir_entry *lprocfs_add_symlink(const char *name, OBD_FREE(dest, MAX_STRING_SIZE + 1); return entry; } +EXPORT_SYMBOL(lprocfs_add_symlink); static ssize_t lprocfs_fops_read(struct file *f, char __user *buf, size_t size, loff_t *ppos) @@ -374,6 +377,7 @@ out: LPROCFS_WRITE_EXIT(); return rc; } +EXPORT_SYMBOL(lprocfs_add_vars); void lprocfs_remove(struct proc_dir_entry **rooth) { @@ -426,12 +430,14 @@ void lprocfs_remove(struct proc_dir_entry **rooth) } LPROCFS_WRITE_EXIT(); } +EXPORT_SYMBOL(lprocfs_remove); void lprocfs_remove_proc_entry(const char *name, struct proc_dir_entry *parent) { LASSERT(parent != NULL); remove_proc_entry(name, parent); } +EXPORT_SYMBOL(lprocfs_remove_proc_entry); struct proc_dir_entry *lprocfs_register(const char *name, struct proc_dir_entry *parent, @@ -456,6 +462,7 @@ struct proc_dir_entry *lprocfs_register(const char *name, } return newchild; } +EXPORT_SYMBOL(lprocfs_register); /* Generic callbacks */ int lprocfs_rd_uint(char *page, char **start, off_t off, @@ -464,6 +471,7 @@ int lprocfs_rd_uint(char *page, char **start, off_t off, unsigned int *temp = data; return snprintf(page, count, "%u\n", *temp); } +EXPORT_SYMBOL(lprocfs_rd_uint); int lprocfs_wr_uint(struct file *file, const char *buffer, unsigned long count, void *data) @@ -483,6 +491,7 @@ int lprocfs_wr_uint(struct file *file, const char *buffer, *p = (unsigned int)tmp; return count; } +EXPORT_SYMBOL(lprocfs_wr_uint); int lprocfs_rd_u64(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -491,6 +500,7 @@ int lprocfs_rd_u64(char *page, char **start, off_t off, *eof = 1; return snprintf(page, count, LPU64"\n", *(__u64 *)data); } +EXPORT_SYMBOL(lprocfs_rd_u64); int lprocfs_rd_atomic(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -500,6 +510,7 @@ int lprocfs_rd_atomic(char *page, char **start, off_t off, *eof = 1; return snprintf(page, count, "%d\n", cfs_atomic_read(atom)); } +EXPORT_SYMBOL(lprocfs_rd_atomic); int lprocfs_wr_atomic(struct file *file, const char *buffer, unsigned long count, void *data) @@ -518,6 +529,7 @@ int lprocfs_wr_atomic(struct file *file, const char *buffer, cfs_atomic_set(atm, val); return count; } +EXPORT_SYMBOL(lprocfs_wr_atomic); int lprocfs_rd_uuid(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -528,6 +540,7 @@ int lprocfs_rd_uuid(char *page, char **start, off_t off, int count, *eof = 1; return snprintf(page, count, "%s\n", obd->obd_uuid.uuid); } +EXPORT_SYMBOL(lprocfs_rd_uuid); int lprocfs_rd_name(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -539,6 +552,7 @@ int lprocfs_rd_name(char *page, char **start, off_t off, int count, *eof = 1; return snprintf(page, count, "%s\n", dev->obd_name); } +EXPORT_SYMBOL(lprocfs_rd_name); int lprocfs_rd_fstype(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -550,6 +564,7 @@ int lprocfs_rd_fstype(char *page, char **start, off_t off, int count, int *eof, LASSERT(obd->obd_fsops->fs_type != NULL); return snprintf(page, count, "%s\n", obd->obd_fsops->fs_type); } +EXPORT_SYMBOL(lprocfs_rd_fstype); int lprocfs_rd_blksize(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -565,6 +580,7 @@ int lprocfs_rd_blksize(char *page, char **start, off_t off, int count, } return rc; } +EXPORT_SYMBOL(lprocfs_rd_blksize); int lprocfs_osd_rd_blksize(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -601,6 +617,7 @@ int lprocfs_rd_kbytestotal(char *page, char **start, off_t off, int count, } return rc; } +EXPORT_SYMBOL(lprocfs_rd_kbytestotal); int lprocfs_osd_rd_kbytestotal(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -642,6 +659,7 @@ int lprocfs_rd_kbytesfree(char *page, char **start, off_t off, int count, } return rc; } +EXPORT_SYMBOL(lprocfs_rd_kbytesfree); int lprocfs_osd_rd_kbytesfree(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -683,6 +701,7 @@ int lprocfs_rd_kbytesavail(char *page, char **start, off_t off, int count, } return rc; } +EXPORT_SYMBOL(lprocfs_rd_kbytesavail); int lprocfs_osd_rd_kbytesavail(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -719,6 +738,7 @@ int lprocfs_rd_filestotal(char *page, char **start, off_t off, int count, return rc; } +EXPORT_SYMBOL(lprocfs_rd_filestotal); int lprocfs_osd_rd_filestotal(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -749,6 +769,7 @@ int lprocfs_rd_filesfree(char *page, char **start, off_t off, int count, } return rc; } +EXPORT_SYMBOL(lprocfs_rd_filesfree); int lprocfs_osd_rd_filesfree(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -784,6 +805,7 @@ int lprocfs_rd_server_uuid(char *page, char **start, off_t off, int count, LPROCFS_CLIMP_EXIT(obd); return rc; } +EXPORT_SYMBOL(lprocfs_rd_server_uuid); int lprocfs_rd_conn_uuid(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -807,6 +829,7 @@ int lprocfs_rd_conn_uuid(char *page, char **start, off_t off, int count, LPROCFS_CLIMP_EXIT(obd); return rc; } +EXPORT_SYMBOL(lprocfs_rd_conn_uuid); /** add up per-cpu counters */ void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, @@ -860,6 +883,7 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, cnt->lc_units = stats->ls_percpu[0]->lp_cntr[idx].lc_units; lprocfs_stats_unlock(stats, LPROCFS_GET_NUM_CPU, &flags); } +EXPORT_SYMBOL(lprocfs_stats_collect); /** * Append a space separated list of current set flags to str. @@ -1086,6 +1110,7 @@ int lprocfs_rd_import(char *page, char **start, off_t off, int count, LPROCFS_CLIMP_EXIT(obd); return i; } +EXPORT_SYMBOL(lprocfs_rd_import); int lprocfs_rd_state(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -1117,6 +1142,7 @@ int lprocfs_rd_state(char *page, char **start, off_t off, int count, LPROCFS_CLIMP_EXIT(obd); return i; } +EXPORT_SYMBOL(lprocfs_rd_state); int lprocfs_at_hist_helper(char *page, int count, int rc, struct adaptive_timeout *at) @@ -1127,6 +1153,7 @@ int lprocfs_at_hist_helper(char *page, int count, int rc, rc += snprintf(page + rc, count - rc, "\n"); return rc; } +EXPORT_SYMBOL(lprocfs_at_hist_helper); /* See also ptlrpc_lprocfs_rd_timeouts */ int lprocfs_rd_timeouts(char *page, char **start, off_t off, int count, @@ -1180,6 +1207,7 @@ int lprocfs_rd_timeouts(char *page, char **start, off_t off, int count, LPROCFS_CLIMP_EXIT(obd); return rc; } +EXPORT_SYMBOL(lprocfs_rd_timeouts); int lprocfs_rd_connect_flags(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -1207,6 +1235,7 @@ int lprocfs_rd_num_exports(char *page, char **start, off_t off, int count, *eof = 1; return snprintf(page, count, "%u\n", obd->obd_num_exports); } +EXPORT_SYMBOL(lprocfs_rd_num_exports); int lprocfs_rd_numrefs(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -1217,6 +1246,7 @@ int lprocfs_rd_numrefs(char *page, char **start, off_t off, int count, *eof = 1; return snprintf(page, count, "%d\n", class->typ_refcnt); } +EXPORT_SYMBOL(lprocfs_rd_numrefs); int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list) { @@ -1236,6 +1266,7 @@ int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list) } return rc; } +EXPORT_SYMBOL(lprocfs_obd_setup); int lprocfs_obd_cleanup(struct obd_device *obd) { @@ -1253,6 +1284,7 @@ int lprocfs_obd_cleanup(struct obd_device *obd) } return 0; } +EXPORT_SYMBOL(lprocfs_obd_cleanup); static void lprocfs_free_client_stats(struct nid_stat *client_stat) { @@ -1298,6 +1330,7 @@ void lprocfs_free_per_client_stats(struct obd_device *obd) } EXIT; } +EXPORT_SYMBOL(lprocfs_free_per_client_stats); struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags) @@ -1341,6 +1374,7 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num, } return stats; } +EXPORT_SYMBOL(lprocfs_alloc_stats); void lprocfs_free_stats(struct lprocfs_stats **statsh) { @@ -1366,6 +1400,7 @@ void lprocfs_free_stats(struct lprocfs_stats **statsh) OBD_FREE(stats->ls_percpu[i], percpusize); OBD_FREE(stats, offsetof(typeof(*stats), ls_percpu[num_entry])); } +EXPORT_SYMBOL(lprocfs_free_stats); void lprocfs_clear_stats(struct lprocfs_stats *stats) { @@ -1394,6 +1429,7 @@ void lprocfs_clear_stats(struct lprocfs_stats *stats) lprocfs_stats_unlock(stats, LPROCFS_GET_NUM_CPU, &flags); } +EXPORT_SYMBOL(lprocfs_clear_stats); static ssize_t lprocfs_stats_seq_write(struct file *file, const char *buf, size_t len, loff_t *off) @@ -1525,6 +1561,7 @@ int lprocfs_register_stats(struct proc_dir_entry *root, const char *name, return 0; } +EXPORT_SYMBOL(lprocfs_register_stats); void lprocfs_counter_init(struct lprocfs_stats *stats, int index, unsigned conf, const char *name, const char *units) @@ -1626,6 +1663,7 @@ void lprocfs_init_ops_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_OBD_OP_INIT(num_private_stats, stats, getref); LPROCFS_OBD_OP_INIT(num_private_stats, stats, putref); } +EXPORT_SYMBOL(lprocfs_init_ops_stats); int lprocfs_alloc_obd_stats(struct obd_device *obd, unsigned num_private_stats) { @@ -1664,12 +1702,14 @@ int lprocfs_alloc_obd_stats(struct obd_device *obd, unsigned num_private_stats) } return rc; } +EXPORT_SYMBOL(lprocfs_alloc_obd_stats); void lprocfs_free_obd_stats(struct obd_device *obd) { if (obd->obd_stats) lprocfs_free_stats(&obd->obd_stats); } +EXPORT_SYMBOL(lprocfs_free_obd_stats); #define LPROCFS_MD_OP_INIT(base, stats, op) \ do { \ @@ -1713,6 +1753,7 @@ void lprocfs_init_mps_stats(int num_private_stats, struct lprocfs_stats *stats) LPROCFS_MD_OP_INIT(num_private_stats, stats, intent_getattr_async); LPROCFS_MD_OP_INIT(num_private_stats, stats, revalidate_lock); } +EXPORT_SYMBOL(lprocfs_init_mps_stats); int lprocfs_alloc_md_stats(struct obd_device *obd, unsigned num_private_stats) @@ -1750,6 +1791,7 @@ int lprocfs_alloc_md_stats(struct obd_device *obd, } return rc; } +EXPORT_SYMBOL(lprocfs_alloc_md_stats); void lprocfs_free_md_stats(struct obd_device *obd) { @@ -1761,6 +1803,7 @@ void lprocfs_free_md_stats(struct obd_device *obd) lprocfs_free_stats(&stats); } } +EXPORT_SYMBOL(lprocfs_free_md_stats); void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats) { @@ -1783,6 +1826,7 @@ void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats) LDLM_GL_CALLBACK - LDLM_FIRST_OPC, 0, "ldlm_gl_callback", "reqs"); } +EXPORT_SYMBOL(lprocfs_init_ldlm_stats); int lprocfs_exp_rd_nid(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -2037,6 +2081,7 @@ destroy_new: OBD_FREE_PTR(new_stat); RETURN(rc); } +EXPORT_SYMBOL(lprocfs_exp_setup); int lprocfs_exp_cleanup(struct obd_export *exp) { @@ -2050,12 +2095,14 @@ int lprocfs_exp_cleanup(struct obd_export *exp) return 0; } +EXPORT_SYMBOL(lprocfs_exp_cleanup); int lprocfs_write_helper(const char *buffer, unsigned long count, int *val) { return lprocfs_write_frac_helper(buffer, count, val, 1); } +EXPORT_SYMBOL(lprocfs_write_helper); int lprocfs_write_frac_helper(const char *buffer, unsigned long count, int *val, int mult) @@ -2098,6 +2145,7 @@ int lprocfs_write_frac_helper(const char *buffer, unsigned long count, } return 0; } +EXPORT_SYMBOL(lprocfs_write_frac_helper); int lprocfs_read_frac_helper(char *buffer, unsigned long count, long val, int mult) @@ -2152,11 +2200,13 @@ int lprocfs_read_frac_helper(char *buffer, unsigned long count, long val, buffer[prtn++] ='\n'; return prtn; } +EXPORT_SYMBOL(lprocfs_read_frac_helper); int lprocfs_write_u64_helper(const char *buffer, unsigned long count,__u64 *val) { return lprocfs_write_frac_u64_helper(buffer, count, val, 1); } +EXPORT_SYMBOL(lprocfs_write_u64_helper); int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count, __u64 *val, int mult) @@ -2218,6 +2268,7 @@ int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count, *val = whole * mult + frac; return 0; } +EXPORT_SYMBOL(lprocfs_write_frac_u64_helper); int lprocfs_seq_create(cfs_proc_dir_entry_t *parent, char *name, mode_t mode, struct file_operations *seq_fops, void *data) @@ -2558,58 +2609,4 @@ int lprocfs_target_rd_instance(char *page, char **start, off_t off, return snprintf(page, count, "%u\n", obd->u.obt.obt_instance); } EXPORT_SYMBOL(lprocfs_target_rd_instance); - -EXPORT_SYMBOL(lprocfs_register); -EXPORT_SYMBOL(lprocfs_srch); -EXPORT_SYMBOL(lprocfs_remove); -EXPORT_SYMBOL(lprocfs_remove_proc_entry); -EXPORT_SYMBOL(lprocfs_add_vars); -EXPORT_SYMBOL(lprocfs_obd_setup); -EXPORT_SYMBOL(lprocfs_obd_cleanup); -EXPORT_SYMBOL(lprocfs_add_simple); -EXPORT_SYMBOL(lprocfs_add_symlink); -EXPORT_SYMBOL(lprocfs_free_per_client_stats); -EXPORT_SYMBOL(lprocfs_alloc_stats); -EXPORT_SYMBOL(lprocfs_free_stats); -EXPORT_SYMBOL(lprocfs_clear_stats); -EXPORT_SYMBOL(lprocfs_register_stats); -EXPORT_SYMBOL(lprocfs_init_ops_stats); -EXPORT_SYMBOL(lprocfs_init_mps_stats); -EXPORT_SYMBOL(lprocfs_init_ldlm_stats); -EXPORT_SYMBOL(lprocfs_alloc_obd_stats); -EXPORT_SYMBOL(lprocfs_alloc_md_stats); -EXPORT_SYMBOL(lprocfs_free_obd_stats); -EXPORT_SYMBOL(lprocfs_free_md_stats); -EXPORT_SYMBOL(lprocfs_exp_setup); -EXPORT_SYMBOL(lprocfs_exp_cleanup); - -EXPORT_SYMBOL(lprocfs_rd_u64); -EXPORT_SYMBOL(lprocfs_rd_atomic); -EXPORT_SYMBOL(lprocfs_wr_atomic); -EXPORT_SYMBOL(lprocfs_rd_uint); -EXPORT_SYMBOL(lprocfs_wr_uint); -EXPORT_SYMBOL(lprocfs_rd_uuid); -EXPORT_SYMBOL(lprocfs_rd_name); -EXPORT_SYMBOL(lprocfs_rd_fstype); -EXPORT_SYMBOL(lprocfs_rd_server_uuid); -EXPORT_SYMBOL(lprocfs_rd_conn_uuid); -EXPORT_SYMBOL(lprocfs_rd_num_exports); -EXPORT_SYMBOL(lprocfs_rd_numrefs); -EXPORT_SYMBOL(lprocfs_at_hist_helper); -EXPORT_SYMBOL(lprocfs_rd_import); -EXPORT_SYMBOL(lprocfs_rd_state); -EXPORT_SYMBOL(lprocfs_rd_timeouts); -EXPORT_SYMBOL(lprocfs_rd_blksize); -EXPORT_SYMBOL(lprocfs_rd_kbytestotal); -EXPORT_SYMBOL(lprocfs_rd_kbytesfree); -EXPORT_SYMBOL(lprocfs_rd_kbytesavail); -EXPORT_SYMBOL(lprocfs_rd_filestotal); -EXPORT_SYMBOL(lprocfs_rd_filesfree); - -EXPORT_SYMBOL(lprocfs_write_helper); -EXPORT_SYMBOL(lprocfs_write_frac_helper); -EXPORT_SYMBOL(lprocfs_read_frac_helper); -EXPORT_SYMBOL(lprocfs_write_u64_helper); -EXPORT_SYMBOL(lprocfs_write_frac_u64_helper); -EXPORT_SYMBOL(lprocfs_stats_collect); #endif /* LPROCFS*/ diff --git a/lustre/obdclass/lustre_handles.c b/lustre/obdclass/lustre_handles.c index c3013fd..6cf943b 100644 --- a/lustre/obdclass/lustre_handles.c +++ b/lustre/obdclass/lustre_handles.c @@ -123,6 +123,7 @@ void class_handle_hash(struct portals_handle *h, h, h->h_cookie); EXIT; } +EXPORT_SYMBOL(class_handle_hash); static void class_handle_unhash_nolock(struct portals_handle *h) { @@ -154,6 +155,7 @@ void class_handle_unhash(struct portals_handle *h) class_handle_unhash_nolock(h); cfs_spin_unlock(&bucket->lock); } +EXPORT_SYMBOL(class_handle_unhash); void class_handle_hash_back(struct portals_handle *h) { @@ -169,6 +171,7 @@ void class_handle_hash_back(struct portals_handle *h) EXIT; } +EXPORT_SYMBOL(class_handle_hash_back); void *class_handle2object(__u64 cookie) { @@ -179,8 +182,8 @@ void *class_handle2object(__u64 cookie) LASSERT(handle_hash != NULL); - /* Be careful when you want to change this code. See the - * rcu_read_lock() definition on top this file. - jxiong */ + /* Be careful when you want to change this code. See the + * rcu_read_lock() definition on top this file. - jxiong */ bucket = handle_hash + (cookie & HANDLE_HASH_MASK); rcu_read_lock(); @@ -200,6 +203,7 @@ void *class_handle2object(__u64 cookie) RETURN(retval); } +EXPORT_SYMBOL(class_handle2object); void class_handle_free_cb(cfs_rcu_head_t *rcu) { @@ -211,6 +215,7 @@ void class_handle_free_cb(cfs_rcu_head_t *rcu) else OBD_FREE(ptr, h->h_size); } +EXPORT_SYMBOL(class_handle_free_cb); int class_handle_init(void) { diff --git a/lustre/obdclass/lustre_peer.c b/lustre/obdclass/lustre_peer.c index 261674c..20e14dc 100644 --- a/lustre/obdclass/lustre_peer.c +++ b/lustre/obdclass/lustre_peer.c @@ -93,6 +93,7 @@ int lustre_uuid_to_peer(const char *uuid, lnet_nid_t *peer_nid, int index) cfs_spin_unlock(&g_uuid_lock); return rc; } +EXPORT_SYMBOL(lustre_uuid_to_peer); /* Add a nid to a niduuid. Multiple nids can be added to a single uuid; LNET will choose the best one. */ diff --git a/lustre/obdclass/mea.c b/lustre/obdclass/mea.c index 6943f0e..1082cbc 100644 --- a/lustre/obdclass/mea.c +++ b/lustre/obdclass/mea.c @@ -92,6 +92,7 @@ int raw_name2idx(int hashtype, int count, const char *name, int namelen) LASSERT(c < count); return c; } +EXPORT_SYMBOL(raw_name2idx); int mea_name2idx(struct lmv_stripe_md *mea, const char *name, int namelen) { @@ -104,3 +105,4 @@ int mea_name2idx(struct lmv_stripe_md *mea, const char *name, int namelen) LASSERT(c < mea->mea_count); return c; } +EXPORT_SYMBOL(mea_name2idx); diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index e0e1fca..f67bc3a 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -74,6 +74,7 @@ int class_find_param(char *buf, char *key, char **valp) return 0; } +EXPORT_SYMBOL(class_find_param); /** * Finds a parameter in \a params and copies it to \a copy. @@ -140,6 +141,7 @@ int class_get_next_param(char **params, char *copy) } return 1; } +EXPORT_SYMBOL(class_get_next_param); /* returns 0 if this is the first key in the buffer, else 1. valp points to first char after key. */ @@ -156,6 +158,7 @@ int class_match_param(char *buf, char *key, char **valp) return 0; } +EXPORT_SYMBOL(class_match_param); static int parse_nid(char *buf, void *value) { @@ -229,11 +232,13 @@ int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh) { return class_parse_value(buf, CLASS_PARSE_NID, (void *)nid, endh); } +EXPORT_SYMBOL(class_parse_nid); int class_parse_net(char *buf, __u32 *net, char **endh) { return class_parse_value(buf, CLASS_PARSE_NET, (void *)net, endh); } +EXPORT_SYMBOL(class_parse_net); /* 1 param contains key and match * 0 param contains key and not match @@ -255,6 +260,7 @@ int class_match_nid(char *buf, char *key, lnet_nid_t nid) } return rc; } +EXPORT_SYMBOL(class_match_nid); int class_match_net(char *buf, char *key, __u32 net) { @@ -272,13 +278,6 @@ int class_match_net(char *buf, char *key, __u32 net) } return rc; } - -EXPORT_SYMBOL(class_find_param); -EXPORT_SYMBOL(class_get_next_param); -EXPORT_SYMBOL(class_match_param); -EXPORT_SYMBOL(class_parse_nid); -EXPORT_SYMBOL(class_parse_net); -EXPORT_SYMBOL(class_match_nid); EXPORT_SYMBOL(class_match_net); /********************** class fns **********************/ @@ -397,6 +396,7 @@ int class_attach(struct lustre_cfg *lcfg) } return rc; } +EXPORT_SYMBOL(class_attach); /** Create hashes, self-export, and call type-specific setup. * Setup is effectively the "start this obd" call. @@ -521,6 +521,7 @@ err_hash: CERROR("setup %s failed (%d)\n", obd->obd_name, err); return err; } +EXPORT_SYMBOL(class_setup); /** We have finished using this obd and are ready to destroy it. * There can be no more references to this obd. @@ -549,6 +550,7 @@ int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg) class_decref(obd, "attach", obd); RETURN(0); } +EXPORT_SYMBOL(class_detach); /** Start shutting down the obd. There may be in-progess ops when * this is called. We tell them to start shutting down with a call @@ -652,6 +654,7 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg) RETURN(0); } +EXPORT_SYMBOL(class_cleanup); struct obd_device *class_incref(struct obd_device *obd, const char *scope, const void *source) @@ -663,6 +666,7 @@ struct obd_device *class_incref(struct obd_device *obd, return obd; } +EXPORT_SYMBOL(class_incref); void class_decref(struct obd_device *obd, const char *scope, const void *source) { @@ -709,6 +713,7 @@ void class_decref(struct obd_device *obd, const char *scope, const void *source) class_release_dev(obd); } } +EXPORT_SYMBOL(class_decref); /** Add a failover nid location. * Client obd types contact server obd types using this nid list. @@ -790,6 +795,7 @@ struct lustre_profile *class_get_profile(const char * prof) } RETURN(NULL); } +EXPORT_SYMBOL(class_get_profile); /** Create a named "profile". * This defines the mdc and osc names to use for a client. @@ -861,6 +867,7 @@ void class_del_profile(const char *prof) } EXIT; } +EXPORT_SYMBOL(class_del_profile); /* COMPAT_146 */ void class_del_profiles(void) @@ -878,6 +885,7 @@ void class_del_profiles(void) } EXIT; } +EXPORT_SYMBOL(class_del_profiles); static int class_set_global(char *ptr, int val, struct lustre_cfg *lcfg) { @@ -1162,6 +1170,7 @@ out: } return err; } +EXPORT_SYMBOL(class_process_config); int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, struct lustre_cfg *lcfg, void *data) @@ -1249,6 +1258,7 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, RETURN(0); #endif } +EXPORT_SYMBOL(class_process_proc_param); int class_config_dump_handler(struct llog_handle * handle, struct llog_rec_hdr *rec, void *data); @@ -1487,6 +1497,7 @@ parse_out: RETURN(rc); } +EXPORT_SYMBOL(class_config_parse_llog); int class_config_dump_handler(struct llog_handle * handle, struct llog_rec_hdr *rec, void *data) @@ -1575,6 +1586,7 @@ parse_out: RETURN(rc); } +EXPORT_SYMBOL(class_config_dump_llog); /** Call class_cleanup and class_detach. * "Manual" only in the sense that we're faking lcfg commands. @@ -1621,6 +1633,7 @@ out: lustre_cfg_free(lcfg); RETURN(rc); } +EXPORT_SYMBOL(class_manual_cleanup); /* * uuid<->export lustre hash operations diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index f712c4a..c93a15d 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -182,6 +182,7 @@ struct lustre_mount_info *server_get_mount(const char *name) RETURN(lmi); } +EXPORT_SYMBOL(server_get_mount); /* * Used by mdt to get mount_info from obdname. @@ -201,6 +202,7 @@ struct lustre_mount_info *server_get_mount_2(const char *name) RETURN(lmi); } +EXPORT_SYMBOL(server_get_mount_2); static void unlock_mntput(struct vfsmount *mnt) { @@ -260,6 +262,7 @@ int server_put_mount(const char *name, struct vfsmount *mnt) RETURN(0); } +EXPORT_SYMBOL(server_put_mount); /* Corresponding to server_get_mount_2 */ int server_put_mount_2(const char *name, struct vfsmount *mnt) @@ -267,6 +270,7 @@ int server_put_mount_2(const char *name, struct vfsmount *mnt) ENTRY; RETURN(0); } +EXPORT_SYMBOL(server_put_mount_2); /******* mount helper utilities *********/ @@ -454,6 +458,7 @@ int lustre_process_log(struct super_block *sb, char *logname, /* class_obd_list(); */ RETURN(rc); } +EXPORT_SYMBOL(lustre_process_log); /* Stop watching this config log for updates */ int lustre_end_log(struct super_block *sb, char *logname, @@ -479,6 +484,7 @@ int lustre_end_log(struct super_block *sb, char *logname, lustre_cfg_free(lcfg); RETURN(rc); } +EXPORT_SYMBOL(lustre_end_log); /**************** obd start *******************/ @@ -511,6 +517,7 @@ int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd, lustre_cfg_free(lcfg); return(rc); } +EXPORT_SYMBOL(do_lcfg); /** Call class_attach and class_setup. These methods in turn call * obd type-specific methods. @@ -1022,6 +1029,7 @@ int server_mti_print(char *title, struct mgs_target_info *mti) mti->mti_config_ver, mti->mti_flags); return(0); } +EXPORT_SYMBOL(server_mti_print); static int server_sb2mti(struct super_block *sb, struct mgs_target_info *mti) { @@ -1171,6 +1179,7 @@ out: OBD_FREE_PTR(mti); RETURN(rc); } +EXPORT_SYMBOL(server_register_target); /** * Notify the MGS that this target is ready. @@ -1990,6 +1999,7 @@ int server_name2index(char *svname, __u32 *idx, char **endptr) *idx = index; return rc; } +EXPORT_SYMBOL(server_name2index); /* * Calculate timeout value for a target. @@ -2077,6 +2087,7 @@ int lustre_common_put_super(struct super_block *sb) lu_types_stop(); RETURN(rc); } +EXPORT_SYMBOL(lustre_common_put_super); static void lmd_print(struct lustre_mount_data *lmd) { @@ -2550,11 +2561,13 @@ void lustre_register_client_fill_super(int (*cfs)(struct super_block *sb, { client_fill_super = cfs; } +EXPORT_SYMBOL(lustre_register_client_fill_super); void lustre_register_kill_super_cb(void (*cfs)(struct super_block *sb)) { kill_super_cb = cfs; } +EXPORT_SYMBOL(lustre_register_kill_super_cb); /***************** FS registration ******************/ @@ -2599,17 +2612,3 @@ int lustre_unregister_fs(void) { return unregister_filesystem(&lustre_fs_type); } - -EXPORT_SYMBOL(lustre_register_client_fill_super); -EXPORT_SYMBOL(lustre_register_kill_super_cb); -EXPORT_SYMBOL(lustre_common_put_super); -EXPORT_SYMBOL(lustre_process_log); -EXPORT_SYMBOL(lustre_end_log); -EXPORT_SYMBOL(server_get_mount); -EXPORT_SYMBOL(server_get_mount_2); -EXPORT_SYMBOL(server_put_mount); -EXPORT_SYMBOL(server_put_mount_2); -EXPORT_SYMBOL(server_register_target); -EXPORT_SYMBOL(server_name2index); -EXPORT_SYMBOL(server_mti_print); -EXPORT_SYMBOL(do_lcfg); diff --git a/lustre/obdclass/statfs_pack.c b/lustre/obdclass/statfs_pack.c index eb3ed10..673eade 100644 --- a/lustre/obdclass/statfs_pack.c +++ b/lustre/obdclass/statfs_pack.c @@ -61,6 +61,7 @@ void statfs_pack(struct obd_statfs *osfs, cfs_kstatfs_t *sfs) osfs->os_bsize = sfs->f_bsize; osfs->os_namelen = sfs->f_namelen; } +EXPORT_SYMBOL(statfs_pack); void statfs_unpack(cfs_kstatfs_t *sfs, struct obd_statfs *osfs) { @@ -74,6 +75,4 @@ void statfs_unpack(cfs_kstatfs_t *sfs, struct obd_statfs *osfs) sfs->f_bsize = osfs->os_bsize; sfs->f_namelen = osfs->os_namelen; } - -EXPORT_SYMBOL(statfs_pack); EXPORT_SYMBOL(statfs_unpack); diff --git a/lustre/obdclass/uuid.c b/lustre/obdclass/uuid.c index b706cea..40fb984 100644 --- a/lustre/obdclass/uuid.c +++ b/lustre/obdclass/uuid.c @@ -83,3 +83,4 @@ void class_uuid_unparse(class_uuid_t uu, struct obd_uuid *out) uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7]); } +EXPORT_SYMBOL(class_uuid_unparse);