OSDN Git Service

ubifs: Make use of the helper macro kthread_run()
authorCai Huoqing <caihuoqing@baidu.com>
Thu, 21 Oct 2021 08:43:43 +0000 (16:43 +0800)
committerRichard Weinberger <richard@nod.at>
Thu, 23 Dec 2021 19:23:41 +0000 (20:23 +0100)
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>
fs/ubifs/super.c

index f0fb257..0e7f206 100644 (file)
@@ -1367,7 +1367,7 @@ 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;
@@ -1375,7 +1375,6 @@ static int mount_ubifs(struct ubifs_info *c)
                                  c->bgt_name, err);
                        goto out_wbufs;
                }
-               wake_up_process(c->bgt);
        }
 
        err = ubifs_read_master(c);
@@ -1780,7 +1779,7 @@ 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;
@@ -1788,7 +1787,6 @@ static int ubifs_remount_rw(struct ubifs_info *c)
                          c->bgt_name, err);
                goto out;
        }
-       wake_up_process(c->bgt);
 
        c->orph_buf = vmalloc(c->leb_size);
        if (!c->orph_buf) {