lkml.org 
[lkml]   [2021]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 1/2] docs: Add block device (blkdev) LED trigger documentation
From
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!
========================================================================

\
 
 \ /
  Last update: 2021-09-18 16:44    [W:2.107 / U:1.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site