Commit ca3574bd authored by Eric W. Biederman's avatar Eric W. Biederman

exit: Rename module_put_and_exit to module_put_and_kthread_exit

Update module_put_and_exit to call kthread_exit instead of do_exit.

Change the name to reflect this change in functionality.  All of the
users of module_put_and_exit are causing the current kthread to exit
so this change makes it clear what is happening.  There is no
functional change.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent bbda86e9
...@@ -67,7 +67,7 @@ static int cryptomgr_probe(void *data) ...@@ -67,7 +67,7 @@ static int cryptomgr_probe(void *data)
complete_all(&param->larval->completion); complete_all(&param->larval->completion);
crypto_alg_put(&param->larval->alg); crypto_alg_put(&param->larval->alg);
kfree(param); kfree(param);
module_put_and_exit(0); module_put_and_kthread_exit(0);
} }
static int cryptomgr_schedule_probe(struct crypto_larval *larval) static int cryptomgr_schedule_probe(struct crypto_larval *larval)
...@@ -190,7 +190,7 @@ static int cryptomgr_test(void *data) ...@@ -190,7 +190,7 @@ static int cryptomgr_test(void *data)
crypto_alg_tested(param->driver, err); crypto_alg_tested(param->driver, err);
kfree(param); kfree(param);
module_put_and_exit(0); module_put_and_kthread_exit(0);
} }
static int cryptomgr_schedule_test(struct crypto_alg *alg) static int cryptomgr_schedule_test(struct crypto_alg *alg)
......
...@@ -1139,7 +1139,7 @@ cifs_demultiplex_thread(void *p) ...@@ -1139,7 +1139,7 @@ cifs_demultiplex_thread(void *p)
} }
memalloc_noreclaim_restore(noreclaim_flag); memalloc_noreclaim_restore(noreclaim_flag);
module_put_and_exit(0); module_put_and_kthread_exit(0);
} }
/* /*
......
...@@ -93,7 +93,7 @@ nfs4_callback_svc(void *vrqstp) ...@@ -93,7 +93,7 @@ nfs4_callback_svc(void *vrqstp)
svc_process(rqstp); svc_process(rqstp);
} }
svc_exit_thread(rqstp); svc_exit_thread(rqstp);
module_put_and_exit(0); module_put_and_kthread_exit(0);
return 0; return 0;
} }
...@@ -137,7 +137,7 @@ nfs41_callback_svc(void *vrqstp) ...@@ -137,7 +137,7 @@ nfs41_callback_svc(void *vrqstp)
} }
} }
svc_exit_thread(rqstp); svc_exit_thread(rqstp);
module_put_and_exit(0); module_put_and_kthread_exit(0);
return 0; return 0;
} }
......
...@@ -2689,6 +2689,6 @@ static int nfs4_run_state_manager(void *ptr) ...@@ -2689,6 +2689,6 @@ static int nfs4_run_state_manager(void *ptr)
allow_signal(SIGKILL); allow_signal(SIGKILL);
nfs4_state_manager(clp); nfs4_state_manager(clp);
nfs_put_client(clp); nfs_put_client(clp);
module_put_and_exit(0); module_put_and_kthread_exit(0);
return 0; return 0;
} }
...@@ -986,7 +986,7 @@ nfsd(void *vrqstp) ...@@ -986,7 +986,7 @@ nfsd(void *vrqstp)
/* Release module */ /* Release module */
mutex_unlock(&nfsd_mutex); mutex_unlock(&nfsd_mutex);
module_put_and_exit(0); module_put_and_kthread_exit(0);
return 0; return 0;
} }
......
...@@ -595,9 +595,9 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, ...@@ -595,9 +595,9 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
/* Look for this name: can be of form module:name. */ /* Look for this name: can be of form module:name. */
unsigned long module_kallsyms_lookup_name(const char *name); unsigned long module_kallsyms_lookup_name(const char *name);
extern void __noreturn __module_put_and_exit(struct module *mod, extern void __noreturn __module_put_and_kthread_exit(struct module *mod,
long code); long code);
#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code) #define module_put_and_kthread_exit(code) __module_put_and_kthread_exit(THIS_MODULE, code)
#ifdef CONFIG_MODULE_UNLOAD #ifdef CONFIG_MODULE_UNLOAD
int module_refcount(struct module *mod); int module_refcount(struct module *mod);
...@@ -790,7 +790,7 @@ static inline int unregister_module_notifier(struct notifier_block *nb) ...@@ -790,7 +790,7 @@ static inline int unregister_module_notifier(struct notifier_block *nb)
return 0; return 0;
} }
#define module_put_and_exit(code) do_exit(code) #define module_put_and_kthread_exit(code) kthread_exit(code)
static inline void print_modules(void) static inline void print_modules(void)
{ {
......
...@@ -337,12 +337,12 @@ static inline void add_taint_module(struct module *mod, unsigned flag, ...@@ -337,12 +337,12 @@ static inline void add_taint_module(struct module *mod, unsigned flag,
* A thread that wants to hold a reference to a module only while it * A thread that wants to hold a reference to a module only while it
* is running can call this to safely exit. nfsd and lockd use this. * is running can call this to safely exit. nfsd and lockd use this.
*/ */
void __noreturn __module_put_and_exit(struct module *mod, long code) void __noreturn __module_put_and_kthread_exit(struct module *mod, long code)
{ {
module_put(mod); module_put(mod);
do_exit(code); kthread_exit(code);
} }
EXPORT_SYMBOL(__module_put_and_exit); EXPORT_SYMBOL(__module_put_and_kthread_exit);
/* Find a module section: 0 means not found. */ /* Find a module section: 0 means not found. */
static unsigned int find_sec(const struct load_info *info, const char *name) static unsigned int find_sec(const struct load_info *info, const char *name)
......
...@@ -535,7 +535,7 @@ static int bnep_session(void *arg) ...@@ -535,7 +535,7 @@ static int bnep_session(void *arg)
up_write(&bnep_session_sem); up_write(&bnep_session_sem);
free_netdev(dev); free_netdev(dev);
module_put_and_exit(0); module_put_and_kthread_exit(0);
return 0; return 0;
} }
......
...@@ -323,7 +323,7 @@ static int cmtp_session(void *arg) ...@@ -323,7 +323,7 @@ static int cmtp_session(void *arg)
up_write(&cmtp_session_sem); up_write(&cmtp_session_sem);
kfree(session); kfree(session);
module_put_and_exit(0); module_put_and_kthread_exit(0);
return 0; return 0;
} }
......
...@@ -1305,7 +1305,7 @@ static int hidp_session_thread(void *arg) ...@@ -1305,7 +1305,7 @@ static int hidp_session_thread(void *arg)
l2cap_unregister_user(session->conn, &session->user); l2cap_unregister_user(session->conn, &session->user);
hidp_session_put(session); hidp_session_put(session);
module_put_and_exit(0); module_put_and_kthread_exit(0);
return 0; return 0;
} }
......
...@@ -170,7 +170,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, ...@@ -170,7 +170,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
"do_task_dead", "do_task_dead",
"kthread_exit", "kthread_exit",
"make_task_dead", "make_task_dead",
"__module_put_and_exit", "__module_put_and_kthread_exit",
"complete_and_exit", "complete_and_exit",
"__reiserfs_panic", "__reiserfs_panic",
"lbug_with_loc", "lbug_with_loc",
......
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