Re: [PATCH] sysfs: add /sys/dev/{char, block} to lookup sysfs pathby major:minor

From: H. Peter Anvin
Date: Mon Apr 14 2008 - 14:52:30 EST


Dan Williams wrote:

What are the alternatives?:
1/ Add an ioctl to return the path: Doable, but sysfs is meant to reduce
the need to proliferate ioctl interfaces into the kernel, so this
seems counter productive.

2/ Use udev to create these symlinks: Also doable, but it adds a
udev dependency to utilities that might be running in a limited
environment like an initramfs.


3, of course, is what applications have to do today, which is to do a full-tree search of sysfs.

Given that this appears to be fairly little code it would make sense to me; one could argue if /sys/dev/block/8/32 would be better than /sys/dev/block/8:32, but (a) I don't think it matters and (b) the non-atomicity of the former would

-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/