From patchwork Wed Apr 29 07:46:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 11516333 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D107092C for ; Wed, 29 Apr 2020 07:46:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9E4B32076B for ; Wed, 29 Apr 2020 07:46:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9E4B32076B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4E90E8E0009; Wed, 29 Apr 2020 03:46:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 498538E0001; Wed, 29 Apr 2020 03:46:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 361C28E0009; Wed, 29 Apr 2020 03:46:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id 1F8CA8E0001 for ; Wed, 29 Apr 2020 03:46:36 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DD9FA40CD for ; Wed, 29 Apr 2020 07:46:35 +0000 (UTC) X-FDA: 76760110350.29.wax99_399431b460918 X-Spam-Summary: 2,0,0,9e5cf36d6b93dd77,d41d8cd98f00b204,mcgrof@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:2693:3138:3139:3140:3141:3142:3352:3865:3867:3872:5007:6261:10004:11026:11658:11914:12043:12048:12296:12297:12438:12517:12519:12555:12895:13069:13141:13230:13311:13357:13894:14096:14181:14384:14394:14721:21080:21444:21627:21740:21990:30029:30054,0,RBL:209.85.216.67:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: wax99_399431b460918 X-Filterd-Recvd-Size: 3982 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Apr 2020 07:46:35 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id a7so433937pju.2 for ; Wed, 29 Apr 2020 00:46:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M3p9eZkDL4rEHA+mf+DziMPxePr/ZoUmDl5szec5+p8=; b=C1VFyBR7EAx0CubyHzOPOFEcIFcPP0JZ4UjXUliI+9Zr3/WCqWb6w97tucjEVFtn8s ozJ/1NiPe65nKL6OpkoMDAu59UbEdk0Qf0NidXvlI3AmJjZKwd84wprYsAoI9rSoAeXG yhLp/R33M3lxz9pOWinzQZPkeF55HevCqyPOlJQCAhR+9N1Mp9FbH8hiJEi0CWHypNuG TOdpU49ZUBdCthUvEySrVhuromXUzM2fIjr9xUiIP43YUCsEVs8uIfoM76ZrpCNXdOrH 54o0t6BIidu7BoMi8scE1toqiiOoIbLCu6CouWrKzsv09bmfsuM8DVVGjIH1JZV7M1kv 9qdw== X-Gm-Message-State: AGi0PuZgVGr+ILK/7+GWA3qI36dCI4Dicj4Lljwk4PZz9KNC6jHigIOh hcPxy5mUzpUTirGzQgmIx8M= X-Google-Smtp-Source: APiQypIepM7UkpDZsnPZzlZJGdqb5bC+BXdvy5fR4OB7A7AnaI0/jrmsFgVoflR1BJYu333zB+xnmQ== X-Received: by 2002:a17:90a:fa8d:: with SMTP id cu13mr1631966pjb.27.1588146394821; Wed, 29 Apr 2020 00:46:34 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id r31sm387473pgl.86.2020.04.29.00.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2020 00:46:30 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id E693841C23; Wed, 29 Apr 2020 07:46:29 +0000 (UTC) From: Luis Chamberlain To: axboe@kernel.dk, viro@zeniv.linux.org.uk, bvanassche@acm.org, gregkh@linuxfoundation.org, rostedt@goodmis.org, mingo@redhat.com, jack@suse.cz, ming.lei@redhat.com, nstange@suse.de, akpm@linux-foundation.org Cc: mhocko@suse.com, yukuai3@huawei.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH v3 3/6] blktrace: move blktrace debugfs creation to helper function Date: Wed, 29 Apr 2020 07:46:24 +0000 Message-Id: <20200429074627.5955-4-mcgrof@kernel.org> X-Mailer: git-send-email 2.23.0.rc1 In-Reply-To: <20200429074627.5955-1-mcgrof@kernel.org> References: <20200429074627.5955-1-mcgrof@kernel.org> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Move the work to create the debugfs directory used into a helper. It will make further checks easier to read. This commit introduces no functional changes. Signed-off-by: Luis Chamberlain Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- kernel/trace/blktrace.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index ca39dc3230cb..2c6e6c386ace 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -468,6 +468,18 @@ static void blk_trace_setup_lba(struct blk_trace *bt, } } +static struct dentry *blk_trace_debugfs_dir(struct blk_user_trace_setup *buts, + struct blk_trace *bt) +{ + struct dentry *dir = NULL; + + dir = debugfs_lookup(buts->name, blk_debugfs_root); + if (!dir) + bt->dir = dir = debugfs_create_dir(buts->name, blk_debugfs_root); + + return dir; +} + /* * Setup everything required to start tracing */ @@ -509,9 +521,7 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, ret = -ENOENT; - dir = debugfs_lookup(buts->name, blk_debugfs_root); - if (!dir) - bt->dir = dir = debugfs_create_dir(buts->name, blk_debugfs_root); + dir = blk_trace_debugfs_dir(buts, bt); bt->dev = dev; atomic_set(&bt->dropped, 0);