From patchwork Sun Apr 19 19:45:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 11497861 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 4D082174A for ; Sun, 19 Apr 2020 19:45:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 23B8522244 for ; Sun, 19 Apr 2020 19:45:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23B8522244 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 6FDAA8E000B; Sun, 19 Apr 2020 15:45:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 688288E0003; Sun, 19 Apr 2020 15:45:48 -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 575ED8E000B; Sun, 19 Apr 2020 15:45:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id 3FF1E8E0003 for ; Sun, 19 Apr 2020 15:45:48 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 053B8180ACF84 for ; Sun, 19 Apr 2020 19:45:48 +0000 (UTC) X-FDA: 76725634776.03.start69_4fa7ae453c908 X-Spam-Summary: 2,0,0,8a0e28c84ce51af4,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:3138:3139:3140:3141:3142:3352:3865:3867:4321:4605:5007:6261:9592:10004:11026:11473:11658:11914:12043:12048:12291:12296:12297:12438:12517:12519:12555:12683:12895:13069:13141:13230:13311:13357:13894:14096:14110:14181:14384:14394:14721:21080:21444:21627:21990:30029:30054,0,RBL:209.85.215.193:@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:24,LUA_SUMMARY:none X-HE-Tag: start69_4fa7ae453c908 X-Filterd-Recvd-Size: 4425 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Sun, 19 Apr 2020 19:45:47 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id q18so427907pgm.11 for ; Sun, 19 Apr 2020 12:45:47 -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=LBqvAh1pYV5Fu2bzEcPAYJWpFa0bYvX8DrHKThwj4sE=; b=HZN4ZeBYY6VFDKo2W1BuriZL0OFXz7tfMtnFvN0acqhGLryEAeH/vdBJVTtSZPnuz9 LweTTcEDMToC7/nfnI4DbGTbxdDvnA83qfg0gJbveJnhg2g554DsKvajayzSbuv74o9w xdI92ng9dQiURvyt3HFQWjxfCgkVRsQgK9o8b8HsMKgoIdBwnC4pbaOZZXrQ1ir0p0Vd 1asXQTbroO9BUPRkL0i7Eh+cxyfSwXm+xgdpWkVrgkX1wp6QsC3neb+edtlIXPIu6bGN Z8UGJzoZ0WYVBQ3uorsuyWRmVN5EmJmKT19+LATiZQrgwilxd1FbdidM26OJsRtxOb9+ 9dfg== X-Gm-Message-State: AGi0Pubts9UkrGdqg6/YaImBxc8jUT4rGy3q+xjyeYHV2rsAfSu8ZdN0 X/5GdZFe1CWy+ajqnebtOOk= X-Google-Smtp-Source: APiQypJR1GexWXMsOuzmodtJsMQOkpRREQvUx/laufKXdAZAUebNf6h/SmgSJQg0ohk2VxpwhRFMdg== X-Received: by 2002:aa7:96cf:: with SMTP id h15mr9042692pfq.319.1587325546455; Sun, 19 Apr 2020 12:45:46 -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 13sm10159972pfv.95.2020.04.19.12.45.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2020 12:45:43 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id F313A42079; Sun, 19 Apr 2020 19:45:38 +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 v2 07/10] blktrace: move debugfs file creation to its own function Date: Sun, 19 Apr 2020 19:45:26 +0000 Message-Id: <20200419194529.4872-8-mcgrof@kernel.org> X-Mailer: git-send-email 2.23.0.rc1 In-Reply-To: <20200419194529.4872-1-mcgrof@kernel.org> References: <20200419194529.4872-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 creating the blktrace debugfs files into its own function. We'll expand on this later. Signed-off-by: Luis Chamberlain --- kernel/trace/blktrace.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 909db597b551..9cc0153849c3 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -548,6 +548,25 @@ static struct dentry *blk_trace_debugfs_dir(struct blk_user_trace_setup *buts, return bt->dir; } +static int blk_trace_create_debugfs_files(struct blk_user_trace_setup *buts, + struct dentry *dir, + struct blk_trace *bt) +{ + int ret = -EIO; + + bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt, + &blk_dropped_fops); + + bt->msg_file = debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops); + + bt->rchan = relay_open("trace", dir, buts->buf_size, + buts->buf_nr, &blk_relay_callbacks, bt); + if (!bt->rchan) + return ret; + + return 0; +} + /* * Setup everything required to start tracing */ @@ -597,15 +616,8 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, atomic_set(&bt->dropped, 0); INIT_LIST_HEAD(&bt->running_list); - ret = -EIO; - bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt, - &blk_dropped_fops); - - bt->msg_file = debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops); - - bt->rchan = relay_open("trace", dir, buts->buf_size, - buts->buf_nr, &blk_relay_callbacks, bt); - if (!bt->rchan) + ret = blk_trace_create_debugfs_files(buts, dir, bt); + if (ret) goto err; bt->act_mask = buts->act_mask;