lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 18 Sep 2021 09:43:31 -0500
From:   Ian Pilcher <arequipeno@...il.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     hch@...radead.org, pavel@....cz, linux-leds@...r.kernel.org,
        linux-kernel@...r.kernel.org, kabel@...nel.org
Subject: Re: [PATCH v4 1/2] docs: Add block device (blkdev) LED trigger
 documentation

On 9/18/21 02:07, Greg KH wrote:
> On Fri, Sep 17, 2021 at 03:46:55PM -0500, Ian Pilcher wrote:
>> As far as using kernel names, that would be my preference, but I simply
>> don't know of any way to do so with the existing block API.  To my
>> knowledge, there simply isn't anything like a blkdev_get_by_name() API.

...

> Just use the kernel block device name and that way you do not have to
> parse anything as it is unique and no paths are having to be followed.
> 
> That's the way that other LED apis are working, right?

Greg -

There are 2 existing LED triggers that have similar functionality (i.e.
they allow LEDs to be "associated" with devices by name), and they both
use subsystem-specific APIs to "resolve" those names to the actual
kernel objects on which they operate.

   * The *netdev* trigger uses dev_get_by_name(), which is specific to
     network devices (despite its name).

   * The *tty* trigger uses tty_dev_name_to_number() and
     tty_kopen_shared().

As I've been saying, I simply don't know of any similar API for block
devices.  The block API provides blkdev_get_by_path(), which I am using,
and blkdev_get_by_dev(), which takes the device number (dev_t).

If you know of an API that will allow me to resolve a block device (or
dev_t) by its kernel name, please share that information.

Thanks!

-- 
========================================================================
                  In Soviet Russia, Google searches you!
========================================================================

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ