summaryrefslogtreecommitdiff
path: root/libbcachefs/chardev.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-03-16 19:29:22 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-03-16 19:40:33 -0400
commitabfdc593a532abaa40ac6ca87c1e0c86459f8c87 (patch)
tree4db627c2564af70a98c53c5747e543a7b04465c2 /libbcachefs/chardev.c
parentf1e87c66af3ab12ba7bdb0cc61436c8263e08c85 (diff)
Update bcachefs sources to 83338f5b2cb8 bcachefs: fix for building in userspace
Diffstat (limited to 'libbcachefs/chardev.c')
-rw-r--r--libbcachefs/chardev.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/libbcachefs/chardev.c b/libbcachefs/chardev.c
index 99293915..38defa19 100644
--- a/libbcachefs/chardev.c
+++ b/libbcachefs/chardev.c
@@ -11,6 +11,7 @@
#include "replicas.h"
#include "super.h"
#include "super-io.h"
+#include "thread_with_file.h"
#include <linux/cdev.h>
#include <linux/device.h>
@@ -19,15 +20,8 @@
#include <linux/major.h>
#include <linux/sched/task.h>
#include <linux/slab.h>
-#include <linux/thread_with_file.h>
#include <linux/uaccess.h>
-__must_check
-static int copy_to_user_errcode(void __user *to, const void *from, unsigned long n)
-{
- return copy_to_user(to, from, n) ? -EFAULT : 0;
-}
-
/* returns with ref on ca->ref */
static struct bch_dev *bch2_device_lookup(struct bch_fs *c, u64 dev,
unsigned flags)
@@ -172,9 +166,9 @@ static int bch2_fsck_offline_thread_fn(struct thread_with_stdio *stdio)
bch2_fs_stop(c);
if (ret & 1)
- stdio_redirect_printf(&stdio->stdio, false, "%s: errors fixed\n", c->name);
+ bch2_stdio_redirect_printf(&stdio->stdio, false, "%s: errors fixed\n", c->name);
if (ret & 4)
- stdio_redirect_printf(&stdio->stdio, false, "%s: still has errors\n", c->name);
+ bch2_stdio_redirect_printf(&stdio->stdio, false, "%s: still has errors\n", c->name);
return ret;
}
@@ -236,7 +230,7 @@ static long bch2_ioctl_fsck_offline(struct bch_ioctl_fsck_offline __user *user_a
opt_set(thr->opts, stdio, (u64)(unsigned long)&thr->thr.stdio);
- ret = run_thread_with_stdio(&thr->thr, &bch2_offline_fsck_ops);
+ ret = bch2_run_thread_with_stdio(&thr->thr, &bch2_offline_fsck_ops);
err:
if (ret < 0) {
if (thr)
@@ -439,7 +433,7 @@ static int bch2_data_job_release(struct inode *inode, struct file *file)
{
struct bch_data_ctx *ctx = container_of(file->private_data, struct bch_data_ctx, thr);
- thread_with_file_exit(&ctx->thr);
+ bch2_thread_with_file_exit(&ctx->thr);
kfree(ctx);
return 0;
}
@@ -489,7 +483,7 @@ static long bch2_ioctl_data(struct bch_fs *c,
ctx->c = c;
ctx->arg = arg;
- ret = run_thread_with_file(&ctx->thr,
+ ret = bch2_run_thread_with_file(&ctx->thr,
&bcachefs_data_ops,
bch2_data_thread);
if (ret < 0)
@@ -857,7 +851,7 @@ static long bch2_ioctl_fsck_online(struct bch_fs *c,
goto err;
}
- ret = run_thread_with_stdio(&thr->thr, &bch2_online_fsck_ops);
+ ret = bch2_run_thread_with_stdio(&thr->thr, &bch2_online_fsck_ops);
err:
if (ret < 0) {
bch_err_fn(c, ret);