[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200422071207.GB19116@infradead.org>
Date: Wed, 22 Apr 2020 00:12:07 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: axboe@...nel.dk, viro@...iv.linux.org.uk, bvanassche@....org,
gregkh@...uxfoundation.org, rostedt@...dmis.org, mingo@...hat.com,
jack@...e.cz, ming.lei@...hat.com, nstange@...e.de,
akpm@...ux-foundation.org, mhocko@...e.com, yukuai3@...wei.com,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 02/10] blktrace: move blktrace debugfs creation to
helper function
On Sun, Apr 19, 2020 at 07:45:21PM +0000, Luis Chamberlain wrote:
> 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 <mcgrof@...nel.org>
> ---
> 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);
> +
This creates an > 80 char line. But I also think it is rather confusing
anyway, why not:
dir = debugfs_lookup(buts->name, blk_debugfs_root);
if (dir)
return dir;
bt->dir = debugfs_create_dir(buts->name, blk_debugfs_root);
return bt->dir;
Powered by blists - more mailing lists