summaryrefslogtreecommitdiff
path: root/fs/bcachefs/lru.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-12-05 00:31:54 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:29 -0400
commitd326ab2f5de201b9b7e790c653a2b925e7032d3b (patch)
tree228f5e7af8165a24b890ffbc7501513dbfd24e63 /fs/bcachefs/lru.h
parent179e3434fac14a100bad2edba4fd401bffb67802 (diff)
bcachefs: LRU btree
This implements new persistent LRUs, to be used for buckets containing cached data, as well as stripes ordered by time when a block became empty. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/lru.h')
-rw-r--r--fs/bcachefs/lru.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/bcachefs/lru.h b/fs/bcachefs/lru.h
new file mode 100644
index 000000000000..c3121cfee285
--- /dev/null
+++ b/fs/bcachefs/lru.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _BCACHEFS_LRU_H
+#define _BCACHEFS_LRU_H
+
+const char *bch2_lru_invalid(const struct bch_fs *, struct bkey_s_c);
+void bch2_lru_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
+
+#define bch2_bkey_ops_lru (struct bkey_ops) { \
+ .key_invalid = bch2_lru_invalid, \
+ .val_to_text = bch2_lru_to_text, \
+}
+
+int bch2_lru_change(struct btree_trans *, u64, u64, u64, u64 *);
+
+#endif /* _BCACHEFS_LRU_H */