Loading fs/bcachefs/movinggc.h +9 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,15 @@ unsigned long bch2_copygc_wait_amount(struct bch_fs *); void bch2_copygc_wait_to_text(struct printbuf *, struct bch_fs *); static inline void bch2_copygc_wakeup(struct bch_fs *c) { rcu_read_lock(); struct task_struct *p = rcu_dereference(c->copygc_thread); if (p) wake_up_process(p); rcu_read_unlock(); } void bch2_copygc_stop(struct bch_fs *); int bch2_copygc_start(struct bch_fs *); void bch2_fs_copygc_init(struct bch_fs *); Loading fs/bcachefs/rebalance.c +2 −2 Original line number Diff line number Diff line Loading @@ -262,7 +262,7 @@ int bch2_set_rebalance_needs_scan(struct bch_fs *c, u64 inum) int ret = bch2_trans_commit_do(c, NULL, NULL, BCH_TRANS_COMMIT_no_enospc, bch2_set_rebalance_needs_scan_trans(trans, inum)); rebalance_wakeup(c); bch2_rebalance_wakeup(c); return ret; } Loading Loading @@ -664,7 +664,7 @@ void bch2_rebalance_stop(struct bch_fs *c) c->rebalance.thread = NULL; if (p) { /* for sychronizing with rebalance_wakeup() */ /* for sychronizing with bch2_rebalance_wakeup() */ synchronize_rcu(); kthread_stop(p); Loading fs/bcachefs/rebalance.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ int bch2_set_rebalance_needs_scan_trans(struct btree_trans *, u64); int bch2_set_rebalance_needs_scan(struct bch_fs *, u64 inum); int bch2_set_fs_needs_rebalance(struct bch_fs *); static inline void rebalance_wakeup(struct bch_fs *c) static inline void bch2_rebalance_wakeup(struct bch_fs *c) { struct task_struct *p; Loading fs/bcachefs/super.c +2 −2 Original line number Diff line number Diff line Loading @@ -1500,7 +1500,7 @@ static int bch2_dev_attach_bdev(struct bch_fs *c, struct bch_sb_handle *sb) printbuf_exit(&name); rebalance_wakeup(c); bch2_rebalance_wakeup(c); return 0; } Loading Loading @@ -1646,7 +1646,7 @@ int __bch2_dev_set_state(struct bch_fs *c, struct bch_dev *ca, if (new_state == BCH_MEMBER_STATE_rw) __bch2_dev_read_write(c, ca); rebalance_wakeup(c); bch2_rebalance_wakeup(c); return ret; } Loading fs/bcachefs/sysfs.c +3 −4 Original line number Diff line number Diff line Loading @@ -654,11 +654,10 @@ static ssize_t sysfs_opt_store(struct bch_fs *c, bch2_set_rebalance_needs_scan(c, 0); if (v && id == Opt_rebalance_enabled) rebalance_wakeup(c); bch2_rebalance_wakeup(c); if (v && id == Opt_copygc_enabled && c->copygc_thread) wake_up_process(c->copygc_thread); if (v && id == Opt_copygc_enabled) bch2_copygc_wakeup(c); if (id == Opt_discard && !ca) { mutex_lock(&c->sb_lock); Loading Loading
fs/bcachefs/movinggc.h +9 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,15 @@ unsigned long bch2_copygc_wait_amount(struct bch_fs *); void bch2_copygc_wait_to_text(struct printbuf *, struct bch_fs *); static inline void bch2_copygc_wakeup(struct bch_fs *c) { rcu_read_lock(); struct task_struct *p = rcu_dereference(c->copygc_thread); if (p) wake_up_process(p); rcu_read_unlock(); } void bch2_copygc_stop(struct bch_fs *); int bch2_copygc_start(struct bch_fs *); void bch2_fs_copygc_init(struct bch_fs *); Loading
fs/bcachefs/rebalance.c +2 −2 Original line number Diff line number Diff line Loading @@ -262,7 +262,7 @@ int bch2_set_rebalance_needs_scan(struct bch_fs *c, u64 inum) int ret = bch2_trans_commit_do(c, NULL, NULL, BCH_TRANS_COMMIT_no_enospc, bch2_set_rebalance_needs_scan_trans(trans, inum)); rebalance_wakeup(c); bch2_rebalance_wakeup(c); return ret; } Loading Loading @@ -664,7 +664,7 @@ void bch2_rebalance_stop(struct bch_fs *c) c->rebalance.thread = NULL; if (p) { /* for sychronizing with rebalance_wakeup() */ /* for sychronizing with bch2_rebalance_wakeup() */ synchronize_rcu(); kthread_stop(p); Loading
fs/bcachefs/rebalance.h +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ int bch2_set_rebalance_needs_scan_trans(struct btree_trans *, u64); int bch2_set_rebalance_needs_scan(struct bch_fs *, u64 inum); int bch2_set_fs_needs_rebalance(struct bch_fs *); static inline void rebalance_wakeup(struct bch_fs *c) static inline void bch2_rebalance_wakeup(struct bch_fs *c) { struct task_struct *p; Loading
fs/bcachefs/super.c +2 −2 Original line number Diff line number Diff line Loading @@ -1500,7 +1500,7 @@ static int bch2_dev_attach_bdev(struct bch_fs *c, struct bch_sb_handle *sb) printbuf_exit(&name); rebalance_wakeup(c); bch2_rebalance_wakeup(c); return 0; } Loading Loading @@ -1646,7 +1646,7 @@ int __bch2_dev_set_state(struct bch_fs *c, struct bch_dev *ca, if (new_state == BCH_MEMBER_STATE_rw) __bch2_dev_read_write(c, ca); rebalance_wakeup(c); bch2_rebalance_wakeup(c); return ret; } Loading
fs/bcachefs/sysfs.c +3 −4 Original line number Diff line number Diff line Loading @@ -654,11 +654,10 @@ static ssize_t sysfs_opt_store(struct bch_fs *c, bch2_set_rebalance_needs_scan(c, 0); if (v && id == Opt_rebalance_enabled) rebalance_wakeup(c); bch2_rebalance_wakeup(c); if (v && id == Opt_copygc_enabled && c->copygc_thread) wake_up_process(c->copygc_thread); if (v && id == Opt_copygc_enabled) bch2_copygc_wakeup(c); if (id == Opt_discard && !ca) { mutex_lock(&c->sb_lock); Loading