From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "osandov@osandov.com" <osandov@osandov.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"axboe@fb.com" <axboe@fb.com>
Cc: "kernel-team@fb.com" <kernel-team@fb.com>
Subject: Re: [PATCH v2 01/10] blk-mq: create debugfs directory tree
Date: Fri, 27 Jan 2017 21:56:09 +0000 [thread overview]
Message-ID: <1485554150.13218.3.camel@sandisk.com> (raw)
In-Reply-To: <cc8db53f5dbd7a488822f903b1a9cf6d20d5be24.1485360145.git.osandov@fb.com>
On Wed, 2017-01-25 at 08:06 -0800, Omar Sandoval wrote:
> +=A0=A0=A0=A0=A0=A0=A0for (i =3D 0; i < ARRAY_SIZE(blk_mq_debugfs_ctx_att=
rs); i++) {
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0const struct blk_mq_debugfs=
_attr *attr;
> +
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0attr =3D &blk_mq_debugfs_ct=
x_attrs[i];
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0if (!debugfs_create_file(at=
tr->name, attr->mode, ctx_dir, ctx,
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 attr->fops))
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0ret=
urn -ENOMEM;
> +=A0=A0=A0=A0=A0=A0=A0}
This loop occurs two times. Please consider introducing a helper function,
e.g. debugfs_create_files(). If you follow the same convention as for sysfs=
,
namely to use a sentinel at the end of an attribute array then that helper
function will only need a pointer to the attribute array and won't need the
size of that array.
Bart.=
next prev parent reply other threads:[~2017-01-27 21:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-25 16:06 [PATCH v2 00/10] blk-mq: move debugging information from sysfs to debugfs Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 01/10] blk-mq: create debugfs directory tree Omar Sandoval
2017-01-27 21:56 ` Bart Van Assche [this message]
2017-01-25 16:06 ` [PATCH v2 02/10] blk-mq: add hctx->{state,flags} to debugfs Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 03/10] blk-mq: move hctx->dispatch and ctx->rq_list from sysfs " Omar Sandoval
2017-01-27 22:00 ` Bart Van Assche
2017-01-27 22:03 ` Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 04/10] blk-mq: add extra request information " Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 05/10] sbitmap: add helpers for dumping to a seq_file Omar Sandoval
2017-01-25 22:32 ` [PATCH v3 " Omar Sandoval
2017-01-27 22:06 ` Bart Van Assche
2017-01-25 16:06 ` [PATCH v2 06/10] blk-mq: export software queue pending map to debugfs Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 07/10] blk-mq: move tags and sched_tags info from sysfs " Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 08/10] blk-mq: add tags and sched_tags bitmaps " Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 09/10] blk-mq: move hctx io_poll, stats, and dispatched from sysfs " Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 10/10] blk-mq: move hctx and ctx counters " Omar Sandoval
2017-01-27 15:18 ` [PATCH v2 00/10] blk-mq: move debugging information " Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485554150.13218.3.camel@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=axboe@fb.com \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=osandov@osandov.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.