void (*end_io)(struct dm_buffer *, blk_status_t);
 #ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
 #define MAX_STACK 10
-       struct stack_trace stack_trace;
+       unsigned int stack_len;
        unsigned long stack_entries[MAX_STACK];
 #endif
 };
 #ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
 static void buffer_record_stack(struct dm_buffer *b)
 {
-       b->stack_trace.nr_entries = 0;
-       b->stack_trace.max_entries = MAX_STACK;
-       b->stack_trace.entries = b->stack_entries;
-       b->stack_trace.skip = 2;
-       save_stack_trace(&b->stack_trace);
+       b->stack_len = stack_trace_save(b->stack_entries, MAX_STACK, 2);
 }
 #endif
 
        adjust_total_allocated(b->data_mode, (long)c->block_size);
 
 #ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
-       memset(&b->stack_trace, 0, sizeof(b->stack_trace));
+       b->stack_len = 0;
 #endif
        return b;
 }
                        DMERR("leaked buffer %llx, hold count %u, list %d",
                              (unsigned long long)b->block, b->hold_count, i);
 #ifdef CONFIG_DM_DEBUG_BLOCK_STACK_TRACING
-                       print_stack_trace(&b->stack_trace, 1);
-                       b->hold_count = 0; /* mark unclaimed to avoid BUG_ON below */
+                       stack_trace_print(b->stack_entries, b->stack_len, 1);
+                       /* mark unclaimed to avoid BUG_ON below */
+                       b->hold_count = 0;
 #endif
                }