diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2025-02-20 15:42:51 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-02-20 15:52:55 -0500 |
commit | dd1a882d17d6302bd3f48f87aec4018b75749de6 (patch) | |
tree | f9bf12bc5cf2e54eaa10da4a0a903464c1cf2b73 /libbcachefs/progress.h | |
parent | 3e15e96cb9c90cca6f7fa3465697933c53f51228 (diff) |
Update bcachefs sources to 9736cbbc5cc3 bcachefs: bs > ps support
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/progress.h')
-rw-r--r-- | libbcachefs/progress.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libbcachefs/progress.h b/libbcachefs/progress.h new file mode 100644 index 00000000..23fb1811 --- /dev/null +++ b/libbcachefs/progress.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _BCACHEFS_PROGRESS_H +#define _BCACHEFS_PROGRESS_H + +/* + * Lame progress indicators + * + * We don't like to use these because they print to the dmesg console, which is + * spammy - we much prefer to be wired up to a userspace programm (e.g. via + * thread_with_file) and have it print the progress indicator. + * + * But some code is old and doesn't support that, or runs in a context where + * that's not yet practical (mount). + */ + +struct progress_indicator_state { + unsigned long next_print; + u64 nodes_seen; + u64 nodes_total; + struct btree *last_node; +}; + +void bch2_progress_init(struct progress_indicator_state *, struct bch_fs *, u64); +void bch2_progress_update_iter(struct btree_trans *, + struct progress_indicator_state *, + struct btree_iter *, + const char *); + +#endif /* _BCACHEFS_PROGRESS_H */ |