From: zhenwei pi <pizhenwei@bytedance.com>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux@vger.kernel.org
Subject: Re: Re: [PATCH 4/5] lsblk: introduce 'MQ' column
Date: Mon, 6 Jun 2022 18:45:04 +0800 [thread overview]
Message-ID: <be42364e-5acb-d4cb-432b-66138dff7c81@bytedance.com> (raw)
In-Reply-To: <20220606104117.lbv4tify3qjvp2t3@ws.net.home>
On 6/6/22 18:41, Karel Zak wrote:
> On Fri, Jun 03, 2022 at 08:24:01PM +0800, zhenwei pi wrote:
>> +static void process_mq(struct lsblk_device *dev, char **str)
>> +{
>> + DIR *dir;
>> + struct dirent *d;
>> + unsigned int queues = 0;
>> +
>> + DBG(DEV, ul_debugobj(dev, "%s: process mq", dev->name));
>> +
>> + dir = ul_path_opendir(dev->sysfs, "mq");
>> + if (!dir) {
>> + *str = xstrdup("1");
>> + DBG(DEV, ul_debugobj(dev, "%s: no mq supported, use a single queue", dev->name));
>> + return;
>> + }
>> +
>> + while ((d = xreaddir(dir))) {
>> + if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
>> + continue;
>
> xreaddir() filters "." and "..".
>
> Anyway, there is a function ul_path_count_dirents() that does all the
> work. I made the change in the code.
>
> Karel
>
Hi, Karel
Thanks!
--
zhenwei pi
next prev parent reply other threads:[~2022-06-06 10:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 12:23 [PATCH 0/5] Support --nvme/--virtio and MQ zhenwei pi
2022-06-03 12:23 ` [PATCH 1/5] lsblk: add -N/--nvme zhenwei pi
2022-06-03 12:23 ` [PATCH 2/5] lsblk: support virtio block zhenwei pi
2022-06-03 12:24 ` [PATCH 3/5] lsblk: add -v/--virtio zhenwei pi
2022-06-03 12:24 ` [PATCH 4/5] lsblk: introduce 'MQ' column zhenwei pi
2022-06-06 10:41 ` Karel Zak
2022-06-06 10:45 ` zhenwei pi [this message]
2022-06-03 12:24 ` [PATCH 5/5] lsblk: enable 'MQ' for NVMe/virtio by default zhenwei pi
2022-06-06 10:37 ` [PATCH 0/5] Support --nvme/--virtio and MQ Karel Zak
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=be42364e-5acb-d4cb-432b-66138dff7c81@bytedance.com \
--to=pizhenwei@bytedance.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/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).