/sys/block vs. /sys/class/block
I'm trying to understand why we have /sys/block instead
of /sys/class/block, and so far, I haven't found a single good argument justifying it... It just messes up the so far logical layout of sysfs for no apparent reason.
I also didn't find where /sys/block is created, but that's maybe because I didn't search too hard :) So I'm not coming up with a patch yet, but unless somebody can convince me it should stay here, I'll do so soon.
If the reason not to fix it is backward compatibility, then that would really be a shame we managed already to turn the brand new sysfs into a mess with no hope of fixing it... If there is really a problem there, maybe we could move it and keep a compat symlink for a few kernel revs... ?
Ben.
Quoted 9 lines · Benjamin Herrenschmidt
I'm trying to understand why we have
/sys/blockinstead
of/sys/class/block, and so far, I haven't found a single good argument justifying it... It just messes up the so far logical layout of sysfs for no apparent reason.I also didn't find where
/sys/blockis created, but that's maybe because I didn't search too hard :) So I'm not coming up with a patch yet, but unless somebody can convince me it should stay here, I'll do so soon.
Quoted 6 lines
If the reason not to fix it is backward compatibility, then that would really be a shame we managed already to turn the brand new sysfs into a mess with no hope of fixing it... If there is really a problem there, maybe we could move it and keep a compat symlink for a few kernel revs... ?
Seems like that's where it belongs.
The reason why it is in /sys/block is because it is apparently a "subsystem", and using decl_subsys - drivers/block/genhd.c
Nick
Quoted 5 lines
Seems like that's where it belongs.
The reason why it is in
/sys/blockis because it is apparently a "subsystem", and usingdecl_subsys-drivers/block/genhd.c
I'm not convinced ... If you look at how /sys is organized, it really doesn't make any sense ... block devives are really devices of "class block", wether we have a block "subsystem" in there is irrelevant imho.
Ben.
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 4 lines
Seems like that's where it belongs.
The reason why it is in
/sys/blockis because it is apparently a "subsystem", and usingdecl_subsys-drivers/block/genhd.cI'm not convinced ... If you look at how /sys is organized, it really doesn't make any sense ... block devives are really devices of "class block", wether we have a block "subsystem" in there is irrelevant imho.
Sorry to be unclear: I was agreeing with you ;)
I was just pointing out that the reason it is currently /sys/block is that decl_subsys call.
Quoted 13 lines · Nick Piggin
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 5 lines
Seems like that's where it belongs.
The reason why it is in
/sys/blockis because it is apparently a "subsystem",
and usingdecl_subsys-drivers/block/genhd.cI'm not convinced ... If you look at how /sys is organized, it really doesn't make any sense ... block devives are really devices of "class block", wether we have a block "subsystem" in there is irrelevant imho.
Quoted 4 lines
Sorry to be unclear: I was agreeing with you ;)
I was just pointing out that the reason it is currently
/sys/blockis thatdecl_subsyscall.
Ditto, the question is how to move it with as little pain as possible... I think the symlink approach would be fine.
Signature · 1 line
Jens Axboe
Quoted 2 lines
Ditto, the question is how to move it with as little pain as possible... I think the symlink approach would be fine.
Wow.. I don't even have /sys/class/block (2.6.9-rc2)
Jan Engelhardt
Signature · 1 line
ENOSPC
(please follow list etiquette, don't trim cc lists)
Quoted 4 lines · Jan Engelhardt
Quoted 2 lines
Ditto, the question is how to move it with as little pain as possible... I think the symlink approach would be fine.
Wow.. I don't even have
/sys/class/block(2.6.9-rc2)
That is Ben's point, it is currently misplaced.
Signature · 1 line
Jens Axboe
Quoted 4 lines · Benjamin Herrenschmidt
I'm trying to understand why we have
/sys/blockinstead
of/sys/class/block, and so far, I haven't found a single good argument justifying it... It just messes up the so far logical layout of sysfs for no apparent reason.
Because /sys/block happened before /sys/class did. Al Viro converted the block layer before I got the struct class stuff working properly during 2.5.
And yes, I would like to convert the block layer to use the class stuff, but for right now, I can't as class devices don't allow sub-classes-devices, and getting to that work is _way_ down on my list of things to do.
thanks,
greg k-h
Quoted 6 lines · Greg KH
Quoted 4 lines · Benjamin Herrenschmidt
I'm trying to understand why we have
/sys/blockinstead
of/sys/class/block, and so far, I haven't found a single good argument justifying it... It just messes up the so far logical layout of sysfs for no apparent reason.
Quoted 8 lines
Because
/sys/blockhappened before/sys/classdid. Al Viro converted the block layer before I got the struct class stuff working properly during 2.5.And yes, I would like to convert the block layer to use the class stuff, but for right now, I can't as class devices don't allow sub-classes-devices, and getting to that work is _way_ down on my list of things to do.
but can't we at least artificially move it down to /sys/class anyway for the sake of a sane userland API ?
Ben.
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 10 lines · Greg KH
Quoted 4 lines · Benjamin Herrenschmidt
I'm trying to understand why we have
/sys/blockinstead
of/sys/class/block, and so far, I haven't found a single good argument justifying it... It just messes up the so far logical layout of sysfs for no apparent reason.Because
/sys/blockhappened before/sys/classdid. Al Viro converted the block layer before I got the struct class stuff working properly during 2.5.
Quoted 7 lines
Quoted 4 lines
And yes, I would like to convert the block layer to use the class stuff, but for right now, I can't as class devices don't allow sub-classes-devices, and getting to that work is _way_ down on my list of things to do.
but can't we at least artificially move it down to
/sys/classanyway for the sake of a sane userland API ?
Just as a note, libsysfs treats /sys/block as a class, as if under /sys/class. We felt that's where it belonged and that's where it will end up.... eventually.
Thanks,
Dan
Quoted 5 lines · On Tue, 21 Dec 2004 08:07:50 +0100 Benjamin Herrenschmidt…
Quoted 5 lines
Because
/sys/blockhappened before/sys/classdid. Al Viro converted the block layer before I got the struct class stuff working properly during 2.5.
Quoted 7 lines
Quoted 4 lines
And yes, I would like to convert the block layer to use the class stuff, but for right now, I can't as class devices don't allow sub-classes-devices, and getting to that work is _way_ down on my list of things to do.
but can't we at least artificially move it down to
/sys/classanyway for the sake of a sane userland API ?
Can I then make the obvious suggestion: add a symlink in /sys/class linking to /sys/block and then reverse the symink once the above work has been done and /sys/class/block has been created?
Or is that too gross? :-)
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Quoted 11 lines · Stephen Rothwell
Quoted 10 lines · On Tue, 21 Dec 2004 08:07:50 +0100 Benjamin Herrenschmidt…
Quoted 9 lines
Because
/sys/blockhappened before/sys/classdid. Al Viro converted the block layer before I got the struct class stuff working properly during 2.5.And yes, I would like to convert the block layer to use the class stuff, but for right now, I can't as class devices don't allow sub-classes-devices, and getting to that work is _way_ down on my list of things to do.
Quoted 8 lines
Quoted 2 lines
but can't we at least artificially move it down to
/sys/classanyway for the sake of a sane userland API ?Can I then make the obvious suggestion: add a symlink in
/sys/classlinking to/sys/blockand then reverse the symink once the above work has been done and/sys/class/blockhas been created?Or is that too gross? :-)
It is gross.
But I guess I should ask, who really cares about this, so late in the sysfs structure game? Is /sys/block/ really a big problem for anyone? And if it is, I'd much rather someone make the required driver core changes to fix this up properly, than just put a symlink to paper over some userspace issue.
And as Dan said, libsysfs already handles /sys/block just like any other class structure, so a "sane" userland API already exists that fixes this issue for you.
thanks,
greg k-h
On Tue, Dec 21, 2004 at 10:20:57PM -0800, Greg KH wrote:
[snip]
Quoted 1 line
It is gross.
Indeed.
Quoted 5 lines
But I guess I should ask, who really cares about this, so late in the sysfs structure game? Is
/sys/block/really a big problem for anyone? And if it is, I'd much rather someone make the required driver core changes to fix this up properly, than just put a symlink to paper over some userspace issue.
Maybe because *for once* it'd be nice to actually have inconsistencies gotten rid of in their relative infancy instead of waiting 10 years and then having to explain them as existing only for hysterical raisins...
[snip]
Regards: David Weinehall
Signature · 3 lines
/) David Weinehall <[email protected]> /) Northern lights wander (\ // Maintainer of the v2.0 kernel // Dance across the winter sky // \) http://www.acc.umu.se/~tao/ (/ Full colour fire (/
Quoted 11 lines
Quoted 6 lines
But I guess I should ask, who really cares about this, so late in the sysfs structure game? Is
/sys/block/really a big problem for anyone? And if it is, I'd much rather someone make the required driver core changes to fix this up properly, than just put a symlink to paper over some userspace issue.Maybe because *for once* it'd be nice to actually have inconsistencies gotten rid of in their relative infancy instead of waiting 10 years and then having to explain them as existing only for hysterical raisins...
Agreed.
Ben.
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 7 lines
Quoted 6 lines
But I guess I should ask, who really cares about this, so late in the sysfs structure game? Is
/sys/block/really a big problem for anyone? And if it is, I'd much rather someone make the required driver core changes to fix this up properly, than just put a symlink to paper over some userspace issue.
Quoted 6 lines
Quoted 4 lines
Maybe because *for once* it'd be nice to actually have inconsistencies gotten rid of in their relative infancy instead of waiting 10 years and then having to explain them as existing only for hysterical raisins...
Agreed.
-ENOPATCH :)