Re: [PATCH] pktcdvd: added sysfs interface + bio write queue handling fix

Kay Sievers
2006-09-09T22:52:46Z

On Sat, 2006-09-09 at 14:30 -0700, Greg KH wrote:
> On Sat, Sep 09, 2006 at 08:11:56PM +0200, Thomas Maier wrote:
> > Hello,
> >
> > >> + write_queue_size (r) Contains the size of the bio write
> > >> + queue.
> > ...
> > >> + mapped_to Symbolic link to mapped block device
> > >> + in the /sys/block tree.
> > >
> > > Shouldn't this whole thing be in /sys/class/ instead of /sys/block/ ?
> >
> > Don't know. I thought, the pktcdvd is a block driver, so put
> > the control files into /sys/block ..
> > Is /sys/class better? If yes, where to put it?
>
> Use /sys/class/pktcdvd/ and use struct device instead of struct
> class_device, so I don't have to convert the code later :)

Is this always device specific, or also driver global information? Is
pktcdvd always on a block device? Maybe you just want them to be a group
of attributes in the block device directory where they belong to, like:
/sys/block/sr0/pktcdvd/info
/sys/block/sr0/pktcdvd/write_queue_size
/sys/block/sr0/pktcdvd/...

Does that make sense? We should avoid messing around with symlinks
pointing to other devices, if not absolutely needed. We should also not
create a new device type, just for adding properties to an existing one,
especially if there is not some kind of "device stacking". The
"mapped_to" link to the parent device looks like a wild hack to me, we
should avoid.

Thanks,
Kay