linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: Bart Van Assche <Bart.VanAssche@sandisk.com>
Cc: Omar Sandoval <osandov@fb.com>, Hannes Reinecke <hare@suse.de>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH] blk-mq: Export queue state through /sys/kernel/debug/block/*/state
Date: Thu, 30 Mar 2017 09:27:43 -0600	[thread overview]
Message-ID: <f80153aa-3e7d-0a20-e426-7e58cd7c249d@fb.com> (raw)
In-Reply-To: <1D08B61A9CF0974AA09887BE32D889DA12BA96@ULS-OP-MBXIP03.sdcorp.global.sandisk.com>

On 03/29/2017 03:32 PM, Bart Van Assche wrote:
> Make it possible to check whether or not a block layer queue has
> been stopped. Make it possible to start and to run a blk-mq queue
> from user space.

Looks good, minor nitpicking below.

> +static int blk_queue_flags_show(struct seq_file *m, void *v)
> +{
> +	struct request_queue *q = m->private;
> +	bool sep = false;
> +	int i;
> +
> +	for (i = 0; i < sizeof(q->queue_flags) * BITS_PER_BYTE; i++) {
> +		if (!(q->queue_flags & BIT(i)))
> +			continue;
> +		if (sep)
> +			seq_puts(m, " ");
> +		sep = true;

Put that sep = true in the else branch?

> +	if (strcmp(op, "run") == 0) {
> +		blk_mq_run_hw_queues(q, true);
> +	} else if (strcmp(op, "start") == 0) {
> +		blk_mq_start_stopped_hw_queues(q, true);
> +	} else {
> +		pr_err("%s: unsupported operation %s\n", __func__, op);
> +		return -EINVAL;
> +	}

You are inconsistent with your braces. I'd prefer no braces for single
lines.

Should the error case include valid commands? It'd be nice to have this
available, and not have to resort to looking at the source to figure out
what commands are available.

-- 
Jens Axboe

  reply	other threads:[~2017-03-30 15:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29 21:32 [PATCH] blk-mq: Export queue state through /sys/kernel/debug/block/*/state Bart Van Assche
2017-03-30 15:27 ` Jens Axboe [this message]
2017-03-30 18:10   ` Bart Van Assche
2017-03-30 18:14     ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2017-03-29 20:20 Bart Van Assche
2017-03-29 20:31 ` Jens Axboe
2017-03-30  5:50 ` Hannes Reinecke
2017-03-30 15:16   ` Bart Van Assche
2017-03-30 15:19     ` Jens Axboe
2017-03-30 15:23       ` Bart Van Assche

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=f80153aa-3e7d-0a20-e426-7e58cd7c249d@fb.com \
    --to=axboe@fb.com \
    --cc=Bart.VanAssche@sandisk.com \
    --cc=hare@suse.de \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).