xref: /linux/fs/bcachefs/rebalance.h (revision 4b132aacb0768ac1e652cf517097ea6f237214b9)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_REBALANCE_H
3 #define _BCACHEFS_REBALANCE_H
4 
5 #include "rebalance_types.h"
6 
7 int bch2_set_rebalance_needs_scan(struct bch_fs *, u64 inum);
8 int bch2_set_fs_needs_rebalance(struct bch_fs *);
9 
10 static inline void rebalance_wakeup(struct bch_fs *c)
11 {
12 	struct task_struct *p;
13 
14 	rcu_read_lock();
15 	p = rcu_dereference(c->rebalance.thread);
16 	if (p)
17 		wake_up_process(p);
18 	rcu_read_unlock();
19 }
20 
21 void bch2_rebalance_status_to_text(struct printbuf *, struct bch_fs *);
22 
23 void bch2_rebalance_stop(struct bch_fs *);
24 int bch2_rebalance_start(struct bch_fs *);
25 void bch2_fs_rebalance_init(struct bch_fs *);
26 
27 #endif /* _BCACHEFS_REBALANCE_H */
28