Lines Matching refs:thr

131 	struct thread_with_stdio thr;  member
138 struct fsck_thread *thr = container_of(_thr, struct fsck_thread, thr); in bch2_fsck_thread_exit() local
139 kfree(thr); in bch2_fsck_thread_exit()
144 struct fsck_thread *thr = container_of(stdio, struct fsck_thread, thr); in bch2_fsck_offline_thread_fn() local
145 struct bch_fs *c = thr->c; in bch2_fsck_offline_thread_fn()
151 ret = bch2_fs_start(thr->c); in bch2_fsck_offline_thread_fn()
176 struct fsck_thread *thr = NULL; in bch2_ioctl_fsck_offline() local
207 thr = kzalloc(sizeof(*thr), GFP_KERNEL); in bch2_ioctl_fsck_offline()
208 if (!thr) { in bch2_ioctl_fsck_offline()
213 thr->opts = bch2_opts_empty(); in bch2_ioctl_fsck_offline()
218 bch2_parse_mount_opts(NULL, &thr->opts, NULL, optstr); in bch2_ioctl_fsck_offline()
226 opt_set(thr->opts, stdio, (u64)(unsigned long)&thr->thr.stdio); in bch2_ioctl_fsck_offline()
227 opt_set(thr->opts, read_only, 1); in bch2_ioctl_fsck_offline()
228 opt_set(thr->opts, ratelimit_errors, 0); in bch2_ioctl_fsck_offline()
231 opt_set(thr->opts, nostart, true); in bch2_ioctl_fsck_offline()
233 bch2_thread_with_stdio_init(&thr->thr, &bch2_offline_fsck_ops); in bch2_ioctl_fsck_offline()
235 thr->c = bch2_fs_open(devs.data, arg.nr_devs, thr->opts); in bch2_ioctl_fsck_offline()
237 if (!IS_ERR(thr->c) && in bch2_ioctl_fsck_offline()
238 thr->c->opts.errors == BCH_ON_ERROR_panic) in bch2_ioctl_fsck_offline()
239 thr->c->opts.errors = BCH_ON_ERROR_ro; in bch2_ioctl_fsck_offline()
241 ret = __bch2_run_thread_with_stdio(&thr->thr); in bch2_ioctl_fsck_offline()
248 if (thr) in bch2_ioctl_fsck_offline()
249 bch2_fsck_thread_exit(&thr->thr); in bch2_ioctl_fsck_offline()
427 struct thread_with_file thr; member
436 struct bch_data_ctx *ctx = container_of(arg, struct bch_data_ctx, thr); in bch2_data_thread()
438 ctx->thr.ret = bch2_data_job(ctx->c, &ctx->stats, ctx->arg); in bch2_data_thread()
445 struct bch_data_ctx *ctx = container_of(file->private_data, struct bch_data_ctx, thr); in bch2_data_job_release()
447 bch2_thread_with_file_exit(&ctx->thr); in bch2_data_job_release()
455 struct bch_data_ctx *ctx = container_of(file->private_data, struct bch_data_ctx, thr); in bch2_data_job_read()
496 ret = bch2_run_thread_with_file(&ctx->thr, in bch2_ioctl_data()
780 struct fsck_thread *thr = container_of(stdio, struct fsck_thread, thr); in bch2_fsck_online_thread_fn() local
781 struct bch_fs *c = thr->c; in bch2_fsck_online_thread_fn()
784 c->stdio = &thr->thr.stdio; in bch2_fsck_online_thread_fn()
790 if (opt_defined(thr->opts, fix_errors)) in bch2_fsck_online_thread_fn()
791 c->opts.fix_errors = thr->opts.fix_errors; in bch2_fsck_online_thread_fn()
821 struct fsck_thread *thr = NULL; in bch2_ioctl_fsck_online() local
838 thr = kzalloc(sizeof(*thr), GFP_KERNEL); in bch2_ioctl_fsck_online()
839 if (!thr) { in bch2_ioctl_fsck_online()
844 thr->c = c; in bch2_ioctl_fsck_online()
845 thr->opts = bch2_opts_empty(); in bch2_ioctl_fsck_online()
851 bch2_parse_mount_opts(c, &thr->opts, NULL, optstr); in bch2_ioctl_fsck_online()
859 ret = bch2_run_thread_with_stdio(&thr->thr, &bch2_online_fsck_ops); in bch2_ioctl_fsck_online()
863 if (thr) in bch2_ioctl_fsck_online()
864 bch2_fsck_thread_exit(&thr->thr); in bch2_ioctl_fsck_online()