Re: [PATCH 01/18] docs: Add block device (blkdev) LED trigger documentation

Pavel Machek
2021-09-04T06:29:41Z

[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]

Hi!

> Add Documentation/ABI/testing/sysfs-class-led-trigger-blkdev to
> document:
>
> * /sys/class/leds/<led>/blink_time
> * /sys/class/leds/<led>/interval
> * /sys/class/leds/<led>/mode
> * /sys/class/leds/<led>/add_blkdev
> * /sys/class/leds/<led>/delete_blkdev
> * /sys/class/leds/<led>/block_devices
>
> Add /sys/block/<disk>/blkdev_leds to Documentation/ABI/testing/sysfs-block
>
> Add overview in Documentation/leds/ledtrig-blkdev.rst

> +What: /sys/class/leds/<led>/add_blkdev
> +Date: September 2021
> +Contact: Ian Pilcher <arequipeno@gmail.com>
> +Description:
> + Associate a block device with this LED by writing its kernel
> + name (as shown in /sys/block) to this attribute. Multiple
> + device names may be written at once, separated by whitespace.

This is seriously strange interface.

> +What: /sys/class/leds/<led>/delete_blkdev
> +Date: September 2021
> +Contact: Ian Pilcher <arequipeno@gmail.com>
> +Description:
> + Remove the association between this LED and a block device by
> + writing the device's kernel name to this attribute. Multiple
> + device names may be written at once, separated by whitespace.
> +
> +What: /sys/class/leds/<led>/block_devices
> +Date: September 2021
> +Contact: Ian Pilcher <arequipeno@gmail.com>
> +Description:
> + Directory containing links to all block devices that are
> + associated with this LED.

If you have directory with symlinks, why not use symlink() syscall
instead of add_blkdev, and unlink() syscall instead of delete_blkdev?

Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]