Skip to content

Commit

Permalink
ubifs: Make use of the helper macro kthread_run()
Browse files Browse the repository at this point in the history
Repalce kthread_create/wake_up_process() with kthread_run()
to simplify the code.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Cai Huoqing authored and Richard Weinberger committed Dec 23, 2021
1 parent bc7849e commit d98c6c3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1367,15 +1367,14 @@ static int mount_ubifs(struct ubifs_info *c)
sprintf(c->bgt_name, BGT_NAME_PATTERN, c->vi.ubi_num, c->vi.vol_id);
if (!c->ro_mount) {
/* Create background thread */
c->bgt = kthread_create(ubifs_bg_thread, c, "%s", c->bgt_name);
c->bgt = kthread_run(ubifs_bg_thread, c, "%s", c->bgt_name);
if (IS_ERR(c->bgt)) {
err = PTR_ERR(c->bgt);
c->bgt = NULL;
ubifs_err(c, "cannot spawn \"%s\", error %d",
c->bgt_name, err);
goto out_wbufs;
}
wake_up_process(c->bgt);
}

err = ubifs_read_master(c);
Expand Down Expand Up @@ -1780,15 +1779,14 @@ static int ubifs_remount_rw(struct ubifs_info *c)
goto out;

/* Create background thread */
c->bgt = kthread_create(ubifs_bg_thread, c, "%s", c->bgt_name);
c->bgt = kthread_run(ubifs_bg_thread, c, "%s", c->bgt_name);
if (IS_ERR(c->bgt)) {
err = PTR_ERR(c->bgt);
c->bgt = NULL;
ubifs_err(c, "cannot spawn \"%s\", error %d",
c->bgt_name, err);
goto out;
}
wake_up_process(c->bgt);

c->orph_buf = vmalloc(c->leb_size);
if (!c->orph_buf) {
Expand Down

0 comments on commit d98c6c3

Please sign in to comment.