]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
btrfs: uninline some static inline helpers from tree-log.h
authorDavid Sterba <dsterba@suse.com>
Fri, 16 Feb 2024 13:03:08 +0000 (14:03 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Mar 2024 15:24:53 +0000 (16:24 +0100)
The helpers are doing an initialization or release work, none of which
is performance critical that it would require a static inline, so move
them to the .c file.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c
fs/btrfs/tree-log.h

index d7693368f34f1058b19e45af96f6dc1e63be1a43..472918a5bc73ae4a19d5b6b862306d7a3c5db724 100644 (file)
@@ -2818,6 +2818,52 @@ static void wait_for_writer(struct btrfs_root *root)
        finish_wait(&root->log_writer_wait, &wait);
 }
 
+void btrfs_init_log_ctx(struct btrfs_log_ctx *ctx, struct inode *inode)
+{
+       ctx->log_ret = 0;
+       ctx->log_transid = 0;
+       ctx->log_new_dentries = false;
+       ctx->logging_new_name = false;
+       ctx->logging_new_delayed_dentries = false;
+       ctx->logged_before = false;
+       ctx->inode = inode;
+       INIT_LIST_HEAD(&ctx->list);
+       INIT_LIST_HEAD(&ctx->ordered_extents);
+       INIT_LIST_HEAD(&ctx->conflict_inodes);
+       ctx->num_conflict_inodes = 0;
+       ctx->logging_conflict_inodes = false;
+       ctx->scratch_eb = NULL;
+}
+
+void btrfs_init_log_ctx_scratch_eb(struct btrfs_log_ctx *ctx)
+{
+       struct btrfs_inode *inode = BTRFS_I(ctx->inode);
+
+       if (!test_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &inode->runtime_flags) &&
+           !test_bit(BTRFS_INODE_COPY_EVERYTHING, &inode->runtime_flags))
+               return;
+
+       /*
+        * Don't care about allocation failure. This is just for optimization,
+        * if we fail to allocate here, we will try again later if needed.
+        */
+       ctx->scratch_eb = alloc_dummy_extent_buffer(inode->root->fs_info, 0);
+}
+
+void btrfs_release_log_ctx_extents(struct btrfs_log_ctx *ctx)
+{
+       struct btrfs_ordered_extent *ordered;
+       struct btrfs_ordered_extent *tmp;
+
+       ASSERT(inode_is_locked(ctx->inode));
+
+       list_for_each_entry_safe(ordered, tmp, &ctx->ordered_extents, log_list) {
+               list_del_init(&ordered->log_list);
+               btrfs_put_ordered_extent(ordered);
+       }
+}
+
+
 static inline void btrfs_remove_log_ctx(struct btrfs_root *root,
                                        struct btrfs_log_ctx *ctx)
 {
index 254082a189c323ba753127cd9b7e71bd301c8d2b..22e9cbc8157742bff8175748d52edf74b47fdfd1 100644 (file)
@@ -55,51 +55,9 @@ struct btrfs_log_ctx {
        struct extent_buffer *scratch_eb;
 };
 
-static inline void btrfs_init_log_ctx(struct btrfs_log_ctx *ctx,
-                                     struct inode *inode)
-{
-       ctx->log_ret = 0;
-       ctx->log_transid = 0;
-       ctx->log_new_dentries = false;
-       ctx->logging_new_name = false;
-       ctx->logging_new_delayed_dentries = false;
-       ctx->logged_before = false;
-       ctx->inode = inode;
-       INIT_LIST_HEAD(&ctx->list);
-       INIT_LIST_HEAD(&ctx->ordered_extents);
-       INIT_LIST_HEAD(&ctx->conflict_inodes);
-       ctx->num_conflict_inodes = 0;
-       ctx->logging_conflict_inodes = false;
-       ctx->scratch_eb = NULL;
-}
-
-static inline void btrfs_init_log_ctx_scratch_eb(struct btrfs_log_ctx *ctx)
-{
-       struct btrfs_inode *inode = BTRFS_I(ctx->inode);
-
-       if (!test_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &inode->runtime_flags) &&
-           !test_bit(BTRFS_INODE_COPY_EVERYTHING, &inode->runtime_flags))
-               return;
-
-       /*
-        * Don't care about allocation failure. This is just for optimization,
-        * if we fail to allocate here, we will try again later if needed.
-        */
-       ctx->scratch_eb = alloc_dummy_extent_buffer(inode->root->fs_info, 0);
-}
-
-static inline void btrfs_release_log_ctx_extents(struct btrfs_log_ctx *ctx)
-{
-       struct btrfs_ordered_extent *ordered;
-       struct btrfs_ordered_extent *tmp;
-
-       ASSERT(inode_is_locked(ctx->inode));
-
-       list_for_each_entry_safe(ordered, tmp, &ctx->ordered_extents, log_list) {
-               list_del_init(&ordered->log_list);
-               btrfs_put_ordered_extent(ordered);
-       }
-}
+void btrfs_init_log_ctx(struct btrfs_log_ctx *ctx, struct inode *inode);
+void btrfs_init_log_ctx_scratch_eb(struct btrfs_log_ctx *ctx);
+void btrfs_release_log_ctx_extents(struct btrfs_log_ctx *ctx);
 
 static inline void btrfs_set_log_full_commit(struct btrfs_trans_handle *trans)
 {