summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/thread_with_file.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-02-04 22:49:34 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-03-13 18:39:13 -0400
commita6777ca4ff237d097b3d6186283eb2d2f24071d1 (patch)
treefaff2e5237bacb14d80b4ad4d5f1a543ed52d98f /fs/bcachefs/thread_with_file.h
parent60e1baa872a1550ea7c083977c817ca2ede04eaf (diff)
downloadlinux-a6777ca4ff237d097b3d6186283eb2d2f24071d1.tar.gz
linux-a6777ca4ff237d097b3d6186283eb2d2f24071d1.tar.bz2
linux-a6777ca4ff237d097b3d6186283eb2d2f24071d1.zip
bcachefs: thread_with_stdio: kill thread_with_stdio_done()
Move the cleanup code to a wrapper function, where we can call it after the thread_with_stdio fn exits. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/thread_with_file.h')
-rw-r--r--fs/bcachefs/thread_with_file.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/fs/bcachefs/thread_with_file.h b/fs/bcachefs/thread_with_file.h
index 4243c7c5ad3f..66212fcae226 100644
--- a/fs/bcachefs/thread_with_file.h
+++ b/fs/bcachefs/thread_with_file.h
@@ -21,19 +21,12 @@ struct thread_with_stdio {
struct thread_with_file thr;
struct stdio_redirect stdio;
void (*exit)(struct thread_with_stdio *);
+ void (*fn)(struct thread_with_stdio *);
};
-static inline void thread_with_stdio_done(struct thread_with_stdio *thr)
-{
- thr->thr.done = true;
- thr->stdio.done = true;
- wake_up(&thr->stdio.input.wait);
- wake_up(&thr->stdio.output.wait);
-}
-
int bch2_run_thread_with_stdio(struct thread_with_stdio *,
void (*exit)(struct thread_with_stdio *),
- int (*fn)(void *));
+ void (*fn)(struct thread_with_stdio *));
int bch2_stdio_redirect_read(struct stdio_redirect *, char *, size_t);
int bch2_stdio_redirect_readline(struct stdio_redirect *, char *, size_t);