diff mbox series

[01/18] btrfs-progs: sync and stub-out tree-mod-log.h

Message ID 41610cf9074900784876cb85b00dfa3846778598.1681939316.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: more prep work for syncing ctree.c | expand

Commit Message

Josef Bacik April 19, 2023, 9:23 p.m. UTC
In order to sync ctree.c we're going to have to have definitions for the
tree-mod-log stuff.  However we don't need any of the code, we don't do
live backref lookups in btrfs-progs, so simply sync the header file and
stub all the helpers out.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 kernel-shared/tree-mod-log.h | 96 ++++++++++++++++++++++++++++++++++++
 1 file changed, 96 insertions(+)
 create mode 100644 kernel-shared/tree-mod-log.h
diff mbox series

Patch

diff --git a/kernel-shared/tree-mod-log.h b/kernel-shared/tree-mod-log.h
new file mode 100644
index 00000000..922862b2
--- /dev/null
+++ b/kernel-shared/tree-mod-log.h
@@ -0,0 +1,96 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef BTRFS_TREE_MOD_LOG_H
+#define BTRFS_TREE_MOD_LOG_H
+
+#include "ctree.h"
+
+/* Represents a tree mod log user. */
+struct btrfs_seq_list {
+	struct list_head list;
+	u64 seq;
+};
+
+#define BTRFS_SEQ_LIST_INIT(name) { .list = LIST_HEAD_INIT((name).list), .seq = 0 }
+#define BTRFS_SEQ_LAST            ((u64)-1)
+
+enum btrfs_mod_log_op {
+	BTRFS_MOD_LOG_KEY_REPLACE,
+	BTRFS_MOD_LOG_KEY_ADD,
+	BTRFS_MOD_LOG_KEY_REMOVE,
+	BTRFS_MOD_LOG_KEY_REMOVE_WHILE_FREEING,
+	BTRFS_MOD_LOG_KEY_REMOVE_WHILE_MOVING,
+	BTRFS_MOD_LOG_MOVE_KEYS,
+	BTRFS_MOD_LOG_ROOT_REPLACE,
+};
+
+static inline u64 btrfs_get_tree_mod_seq(struct btrfs_fs_info *fs_info,
+					 struct btrfs_seq_list *elem)
+{
+	return 0;
+}
+
+static inline void btrfs_put_tree_mod_seq(struct btrfs_fs_info *fs_info,
+					  struct btrfs_seq_list *elem)
+{
+}
+
+static inline int btrfs_tree_mod_log_insert_root(struct extent_buffer *old_root,
+						 struct extent_buffer *new_root,
+						 bool log_removal)
+{
+	return 0;
+}
+
+static inline int btrfs_tree_mod_log_insert_key(struct extent_buffer *eb, int slot,
+						enum btrfs_mod_log_op op)
+{
+	return 0;
+}
+
+static inline int btrfs_tree_mod_log_free_eb(struct extent_buffer *eb)
+{
+	return 0;
+}
+
+static inline struct extent_buffer *btrfs_tree_mod_log_rewind(struct btrfs_fs_info *fs_info,
+							      struct btrfs_path *path,
+							      struct extent_buffer *eb,
+							      u64 time_seq)
+{
+	return NULL;
+}
+
+static inline struct extent_buffer *btrfs_get_old_root(struct btrfs_root *root,
+						       u64 time_seq)
+{
+	return NULL;
+}
+
+static inline int btrfs_old_root_level(struct btrfs_root *root, u64 time_seq)
+{
+	return btrfs_header_level(root->node);
+}
+
+static inline int btrfs_tree_mod_log_eb_copy(struct extent_buffer *dst,
+					     struct extent_buffer *src,
+					     unsigned long dst_offset,
+					     unsigned long src_offset,
+					     int nr_items)
+{
+	return 0;
+}
+
+static inline int btrfs_tree_mod_log_insert_move(struct extent_buffer *eb,
+						 int dst_slot, int src_slot,
+						 int nr_items)
+{
+	return 0;
+}
+
+static inline u64 btrfs_tree_mod_log_lowest_seq(struct btrfs_fs_info *fs_info)
+{
+	return 0;
+}
+
+#endif