summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-inode.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2024-02-16 13:57:49 +0100
committerDavid Sterba <dsterba@suse.com>2024-03-04 16:24:53 +0100
commit585ab6921486dd3a004ceb59f0492db48e3eb0f2 (patch)
treed7962eb07e24f5dae2ddfeb291c28e6ca0fdf262 /fs/btrfs/delayed-inode.c
parentbtrfs: uninline some static inline helpers from backref.h (diff)
downloadlinux-585ab6921486dd3a004ceb59f0492db48e3eb0f2.tar.xz
linux-585ab6921486dd3a004ceb59f0492db48e3eb0f2.zip
btrfs: uninline btrfs_init_delayed_root()
This is a simple initializer and not on any hot path, it does not need to be static inline. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
-rw-r--r--fs/btrfs/delayed-inode.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index efe435403b77..920225658fb1 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -43,6 +43,17 @@ void __cold btrfs_delayed_inode_exit(void)
kmem_cache_destroy(delayed_node_cache);
}
+void btrfs_init_delayed_root(struct btrfs_delayed_root *delayed_root)
+{
+ atomic_set(&delayed_root->items, 0);
+ atomic_set(&delayed_root->items_seq, 0);
+ delayed_root->nodes = 0;
+ spin_lock_init(&delayed_root->lock);
+ init_waitqueue_head(&delayed_root->wait);
+ INIT_LIST_HEAD(&delayed_root->node_list);
+ INIT_LIST_HEAD(&delayed_root->prepare_list);
+}
+
static inline void btrfs_init_delayed_node(
struct btrfs_delayed_node *delayed_node,
struct btrfs_root *root, u64 inode_id)