Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4814562yba; Wed, 10 Apr 2019 05:36:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY7EOvDysrioN2W0ZenJmrdfGbXFe/KUpdCr3gFF19+9+4NLLIAiiMYFXDw+OCm04PMfju X-Received: by 2002:a17:902:7841:: with SMTP id e1mr43013779pln.303.1554899789598; Wed, 10 Apr 2019 05:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554899789; cv=none; d=google.com; s=arc-20160816; b=Dph4ZdPnygaJD0bJzaaw3pfRu8UP9r/ySVlmTFpFzHGjzVFad03SjOK2lOTFIDSb41 SM0wJEdXXnAU0hpkwcwgIG8DUmI765gelwSpKMqUMYzvAppSzLwbGW9IwGSTQUyMQtqL uQe7ffx7PDxJgA51/oAvnSG1sYXgUPnRw0+OqqfivqTRe86iWRIe4EoNly7OnpsJLioq cXxTaDQ6AADUKRoblJp1TlHTQfekh0alrz/f0kZ6335VhlSHejg+z02vOtVqWRoVoSt2 63TfxhWBcqEzYc7oj+RDcDilKwhkM/d6p0A/WQV3gl1Onb7J1HTBDO1hrKMaa9pX1Vrj 4Ekg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:subject:cc:to :from:date:user-agent:message-id; bh=b7Vx/j1S3viZvH31kQeiETi8ObtsKKp+JI+JwiX4xsE=; b=jDKQwJ4Hit91h2fUxl8Q3JAZWZRUf+dOTcDqSMSm1FWbYeq+nRnUgz3zWhXCpaDDLP 2kqwmDc3jCE0ZR7mvMmvQ9kmYNvv50lFYg7MaXVDoPtKnng1r2sHY309LPUIkJVXC0Xm piX4Qto5fZcFSwcQNq4+7yGfreyPFjp1AmJoBFKIvLs7FWMD5bLgqoSXxlAwnrZVU3KM G5gfTrHryo3fHCWD6wEB4mmcxWno6cPv3Lr1n+eLcuO+PLX84+1tYXO6YlM5UoYnrDzI eS4aOMA3LMNaLfn+Thl47Zac5dLGPWS5pc2EHT1nByf0NQhLpeQqnIRVfO7RXXio0wBJ JFaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k66si31926948pgc.247.2019.04.10.05.36.13; Wed, 10 Apr 2019 05:36:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729175AbfDJLHR (ORCPT + 99 others); Wed, 10 Apr 2019 07:07:17 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:59019 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731189AbfDJLGU (ORCPT ); Wed, 10 Apr 2019 07:06:20 -0400 Received: from localhost ([127.0.0.1] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1hEB3O-0005C8-63; Wed, 10 Apr 2019 13:06:06 +0200 Message-Id: <20190410103646.221275815@linutronix.de> User-Agent: quilt/0.65 Date: Wed, 10 Apr 2019 12:28:23 +0200 From: Thomas Gleixner To: LKML Cc: Josh Poimboeuf , x86@kernel.org, Andy Lutomirski , Steven Rostedt , Alexander Potapenko , David Sterba , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org Subject: [RFC patch 29/41] btrfs: ref-verify: Simplify stack trace retrieval References: <20190410102754.387743324@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the indirection through struct stack_trace with an invocation of the storage array based interface. Signed-off-by: Thomas Gleixner Cc: David Sterba Cc: Chris Mason Cc: Josef Bacik Cc: linux-btrfs@vger.kernel.org --- fs/btrfs/ref-verify.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -205,28 +205,17 @@ static struct root_entry *lookup_root_en #ifdef CONFIG_STACKTRACE static void __save_stack_trace(struct ref_action *ra) { - struct stack_trace stack_trace; - - stack_trace.max_entries = MAX_TRACE; - stack_trace.nr_entries = 0; - stack_trace.entries = ra->trace; - stack_trace.skip = 2; - save_stack_trace(&stack_trace); - ra->trace_len = stack_trace.nr_entries; + ra->trace_len = stack_trace_save(ra->trace, MAX_TRACE, 2); } static void __print_stack_trace(struct btrfs_fs_info *fs_info, struct ref_action *ra) { - struct stack_trace trace; - if (ra->trace_len == 0) { btrfs_err(fs_info, " ref-verify: no stacktrace"); return; } - trace.nr_entries = ra->trace_len; - trace.entries = ra->trace; - print_stack_trace(&trace, 2); + stack_trace_print(ra->trace, ra->trace_len, 2); } #else static void inline __save_stack_trace(struct ref_action *ra)