Prepend spl_ to all init/fini functions

This is a bit of cleanup I'd been meaning to get to for a while
to reduce the chance of a type conflict.  Well that conflict
finally occurred with the kstat_init() function which conflicts
with a function in the 2.6.32-6-pve kernel.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #56
This commit is contained in:
Brian Behlendorf 2011-11-11 09:03:31 -08:00
parent 948914d2f1
commit 1114ae6ae7
11 changed files with 39 additions and 35 deletions

View File

@ -47,7 +47,7 @@ struct proc_dir_entry *proc_dir_entry_find(struct proc_dir_entry *root,
const char *str); const char *str);
int proc_dir_entries(struct proc_dir_entry *root); int proc_dir_entries(struct proc_dir_entry *root);
int proc_init(void); int spl_proc_init(void);
void proc_fini(void); void spl_proc_fini(void);
#endif /* SPL_PROC_H */ #endif /* SPL_PROC_H */

View File

@ -186,7 +186,7 @@ extern void spl_debug_dumpstack(struct task_struct *tsk);
extern int spl_debug_clear_buffer(void); extern int spl_debug_clear_buffer(void);
extern int spl_debug_mark_buffer(char *text); extern int spl_debug_mark_buffer(char *text);
int debug_init(void); int spl_debug_init(void);
void debug_fini(void); void spl_debug_fini(void);
#endif /* SPL_DEBUG_INTERNAL_H */ #endif /* SPL_DEBUG_INTERNAL_H */

View File

@ -146,8 +146,8 @@ typedef struct kstat_timer {
hrtime_t stop_time; /* previous event stop time */ hrtime_t stop_time; /* previous event stop time */
} kstat_timer_t; } kstat_timer_t;
int kstat_init(void); int spl_kstat_init(void);
void kstat_fini(void); void spl_kstat_fini(void);
extern kstat_t *__kstat_create(const char *ks_module, int ks_instance, extern kstat_t *__kstat_create(const char *ks_module, int ks_instance,
const char *ks_name, const char *ks_class, const char *ks_name, const char *ks_class,

View File

@ -39,7 +39,7 @@ extern void tsd_create(uint_t *, dtor_func_t);
extern void tsd_destroy(uint_t *); extern void tsd_destroy(uint_t *);
extern void tsd_exit(void); extern void tsd_exit(void);
int tsd_init(void); int spl_tsd_init(void);
void tsd_fini(void); void spl_tsd_fini(void);
#endif /* _SPL_TSD_H */ #endif /* _SPL_TSD_H */

View File

@ -63,7 +63,7 @@ extern int z_compress_level(void *dest, size_t *destLen, const void *source,
extern int z_uncompress(void *dest, size_t *destLen, const void *source, extern int z_uncompress(void *dest, size_t *destLen, const void *source,
size_t sourceLen); size_t sourceLen);
int zlib_init(void); int spl_zlib_init(void);
void zlib_fini(void); void spl_zlib_fini(void);
#endif /* SPL_ZMOD_H */ #endif /* SPL_ZMOD_H */

View File

@ -1176,7 +1176,7 @@ out:
} }
int int
debug_init(void) spl_debug_init(void)
{ {
int rc, max = spl_debug_mb; int rc, max = spl_debug_mb;
@ -1244,7 +1244,7 @@ trace_fini(void)
} }
void void
debug_fini(void) spl_debug_fini(void)
{ {
trace_fini(); trace_fini();
} }

View File

@ -546,7 +546,7 @@ __init spl_init(void)
{ {
int rc = 0; int rc = 0;
if ((rc = debug_init())) if ((rc = spl_debug_init()))
return rc; return rc;
if ((rc = spl_kmem_init())) if ((rc = spl_kmem_init()))
@ -564,16 +564,16 @@ __init spl_init(void)
if ((rc = spl_vn_init())) if ((rc = spl_vn_init()))
SGOTO(out5, rc); SGOTO(out5, rc);
if ((rc = proc_init())) if ((rc = spl_proc_init()))
SGOTO(out6, rc); SGOTO(out6, rc);
if ((rc = kstat_init())) if ((rc = spl_kstat_init()))
SGOTO(out7, rc); SGOTO(out7, rc);
if ((rc = tsd_init())) if ((rc = spl_tsd_init()))
SGOTO(out8, rc); SGOTO(out8, rc);
if ((rc = zlib_init())) if ((rc = spl_zlib_init()))
SGOTO(out9, rc); SGOTO(out9, rc);
/* /*
@ -601,13 +601,13 @@ __init spl_init(void)
SPL_META_VERSION, SPL_DEBUG_STR, (unsigned int) spl_hostid); SPL_META_VERSION, SPL_DEBUG_STR, (unsigned int) spl_hostid);
SRETURN(rc); SRETURN(rc);
out10: out10:
zlib_fini(); spl_zlib_fini();
out9: out9:
tsd_fini(); spl_tsd_fini();
out8: out8:
kstat_fini(); spl_kstat_fini();
out7: out7:
proc_fini(); spl_proc_fini();
out6: out6:
spl_vn_fini(); spl_vn_fini();
out5: out5:
@ -619,7 +619,7 @@ out3:
out2: out2:
spl_kmem_fini(); spl_kmem_fini();
out1: out1:
debug_fini(); spl_debug_fini();
printk(KERN_NOTICE "SPL: Failed to Load Solaris Porting Layer v%s%s" printk(KERN_NOTICE "SPL: Failed to Load Solaris Porting Layer v%s%s"
", rc = %d\n", SPL_META_VERSION, SPL_DEBUG_STR, rc); ", rc = %d\n", SPL_META_VERSION, SPL_DEBUG_STR, rc);
@ -633,16 +633,16 @@ spl_fini(void)
printk(KERN_NOTICE "SPL: Unloaded module v%s%s\n", printk(KERN_NOTICE "SPL: Unloaded module v%s%s\n",
SPL_META_VERSION, SPL_DEBUG_STR); SPL_META_VERSION, SPL_DEBUG_STR);
zlib_fini(); spl_zlib_fini();
tsd_fini(); spl_tsd_fini();
kstat_fini(); spl_kstat_fini();
proc_fini(); spl_proc_fini();
spl_vn_fini(); spl_vn_fini();
spl_taskq_fini(); spl_taskq_fini();
spl_rw_fini(); spl_rw_fini();
spl_mutex_fini(); spl_mutex_fini();
spl_kmem_fini(); spl_kmem_fini();
debug_fini(); spl_debug_fini();
} }
/* Called when a dependent module is loaded */ /* Called when a dependent module is loaded */

View File

@ -477,7 +477,7 @@ __kstat_delete(kstat_t *ksp)
EXPORT_SYMBOL(__kstat_delete); EXPORT_SYMBOL(__kstat_delete);
int int
kstat_init(void) spl_kstat_init(void)
{ {
SENTRY; SENTRY;
spin_lock_init(&kstat_lock); spin_lock_init(&kstat_lock);
@ -487,7 +487,7 @@ kstat_init(void)
} }
void void
kstat_fini(void) spl_kstat_fini(void)
{ {
SENTRY; SENTRY;
ASSERT(list_empty(&kstat_list)); ASSERT(list_empty(&kstat_list));

View File

@ -1139,7 +1139,7 @@ proc_dir_entries(struct proc_dir_entry *root)
} }
int int
proc_init(void) spl_proc_init(void)
{ {
int rc = 0; int rc = 0;
SENTRY; SENTRY;
@ -1186,7 +1186,7 @@ out:
} }
void void
proc_fini(void) spl_proc_fini(void)
{ {
SENTRY; SENTRY;

View File

@ -618,7 +618,8 @@ tsd_exit(void)
} }
EXPORT_SYMBOL(tsd_exit); EXPORT_SYMBOL(tsd_exit);
int tsd_init(void) int
spl_tsd_init(void)
{ {
SENTRY; SENTRY;
@ -629,7 +630,8 @@ int tsd_init(void)
SRETURN(0); SRETURN(0);
} }
void tsd_fini(void) void
spl_tsd_fini(void)
{ {
SENTRY; SENTRY;
tsd_hash_table_fini(tsd_hash_table); tsd_hash_table_fini(tsd_hash_table);

View File

@ -196,7 +196,8 @@ z_uncompress(void *dest, size_t *destLen, const void *source, size_t sourceLen)
} }
EXPORT_SYMBOL(z_uncompress); EXPORT_SYMBOL(z_uncompress);
int zlib_init(void) int
spl_zlib_init(void)
{ {
int size; int size;
SENTRY; SENTRY;
@ -212,7 +213,8 @@ int zlib_init(void)
SRETURN(0); SRETURN(0);
} }
void zlib_fini(void) void
spl_zlib_fini(void)
{ {
SENTRY; SENTRY;
kmem_cache_destroy(zlib_workspace_cache); kmem_cache_destroy(zlib_workspace_cache);