Loading fs/bcachefs/chardev.c +3 −1 Original line number Diff line number Diff line Loading @@ -232,13 +232,15 @@ static long bch2_ioctl_fsck_offline(struct bch_ioctl_fsck_offline __user *user_a /* We need request_key() to be called before we punt to kthread: */ opt_set(thr->opts, nostart, true); bch2_thread_with_stdio_init(&thr->thr, &bch2_offline_fsck_ops); thr->c = bch2_fs_open(devs.data, arg.nr_devs, thr->opts); if (!IS_ERR(thr->c) && thr->c->opts.errors == BCH_ON_ERROR_panic) thr->c->opts.errors = BCH_ON_ERROR_ro; ret = bch2_run_thread_with_stdio(&thr->thr, &bch2_offline_fsck_ops); ret = __bch2_run_thread_with_stdio(&thr->thr); out: darray_for_each(devs, i) kfree(*i); Loading fs/bcachefs/thread_with_file.c +13 −2 Original line number Diff line number Diff line Loading @@ -294,16 +294,27 @@ static int thread_with_stdio_fn(void *arg) return 0; } int bch2_run_thread_with_stdio(struct thread_with_stdio *thr, void bch2_thread_with_stdio_init(struct thread_with_stdio *thr, const struct thread_with_stdio_ops *ops) { stdio_buf_init(&thr->stdio.input); stdio_buf_init(&thr->stdio.output); thr->ops = ops; } int __bch2_run_thread_with_stdio(struct thread_with_stdio *thr) { return bch2_run_thread_with_file(&thr->thr, &thread_with_stdio_fops, thread_with_stdio_fn); } int bch2_run_thread_with_stdio(struct thread_with_stdio *thr, const struct thread_with_stdio_ops *ops) { bch2_thread_with_stdio_init(thr, ops); return __bch2_run_thread_with_stdio(thr); } int bch2_run_thread_with_stdout(struct thread_with_stdio *thr, const struct thread_with_stdio_ops *ops) { Loading fs/bcachefs/thread_with_file.h +3 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,9 @@ struct thread_with_stdio { const struct thread_with_stdio_ops *ops; }; void bch2_thread_with_stdio_init(struct thread_with_stdio *, const struct thread_with_stdio_ops *); int __bch2_run_thread_with_stdio(struct thread_with_stdio *); int bch2_run_thread_with_stdio(struct thread_with_stdio *, const struct thread_with_stdio_ops *); int bch2_run_thread_with_stdout(struct thread_with_stdio *, Loading Loading
fs/bcachefs/chardev.c +3 −1 Original line number Diff line number Diff line Loading @@ -232,13 +232,15 @@ static long bch2_ioctl_fsck_offline(struct bch_ioctl_fsck_offline __user *user_a /* We need request_key() to be called before we punt to kthread: */ opt_set(thr->opts, nostart, true); bch2_thread_with_stdio_init(&thr->thr, &bch2_offline_fsck_ops); thr->c = bch2_fs_open(devs.data, arg.nr_devs, thr->opts); if (!IS_ERR(thr->c) && thr->c->opts.errors == BCH_ON_ERROR_panic) thr->c->opts.errors = BCH_ON_ERROR_ro; ret = bch2_run_thread_with_stdio(&thr->thr, &bch2_offline_fsck_ops); ret = __bch2_run_thread_with_stdio(&thr->thr); out: darray_for_each(devs, i) kfree(*i); Loading
fs/bcachefs/thread_with_file.c +13 −2 Original line number Diff line number Diff line Loading @@ -294,16 +294,27 @@ static int thread_with_stdio_fn(void *arg) return 0; } int bch2_run_thread_with_stdio(struct thread_with_stdio *thr, void bch2_thread_with_stdio_init(struct thread_with_stdio *thr, const struct thread_with_stdio_ops *ops) { stdio_buf_init(&thr->stdio.input); stdio_buf_init(&thr->stdio.output); thr->ops = ops; } int __bch2_run_thread_with_stdio(struct thread_with_stdio *thr) { return bch2_run_thread_with_file(&thr->thr, &thread_with_stdio_fops, thread_with_stdio_fn); } int bch2_run_thread_with_stdio(struct thread_with_stdio *thr, const struct thread_with_stdio_ops *ops) { bch2_thread_with_stdio_init(thr, ops); return __bch2_run_thread_with_stdio(thr); } int bch2_run_thread_with_stdout(struct thread_with_stdio *thr, const struct thread_with_stdio_ops *ops) { Loading
fs/bcachefs/thread_with_file.h +3 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,9 @@ struct thread_with_stdio { const struct thread_with_stdio_ops *ops; }; void bch2_thread_with_stdio_init(struct thread_with_stdio *, const struct thread_with_stdio_ops *); int __bch2_run_thread_with_stdio(struct thread_with_stdio *); int bch2_run_thread_with_stdio(struct thread_with_stdio *, const struct thread_with_stdio_ops *); int bch2_run_thread_with_stdout(struct thread_with_stdio *, Loading