Re: [PATCH, RFC] sysfs: relay channel buffers as sysfs attributes

From: Greg KH
Date: Mon Feb 20 2006 - 17:33:48 EST


On Sun, Feb 19, 2006 at 08:52:54PM +0200, Paul Mundt wrote:
> On Sun, Feb 19, 2006 at 09:56:23AM -0800, Greg KH wrote:
> > Note that Pat isn't the sysfs maintainer anymore :)
> >
> My mistake, I'll check MAINTAINERS instead of the file comments next
> time.
>
> > On Sun, Feb 19, 2006 at 07:17:48PM +0200, Paul Mundt wrote:
> > > Now with relayfs integrated and the relay_file_operations exported for
> > > use by other file systems, I wonder what people think about adding in a
> > > sysfs attribute for setting up channel buffers.
> >
> > Looks good, I like it. This properly handles the module owner stuff,
> > too, right?
> >
> Could you elaborate on which module owner issue you're referring to?
> struct relay_attribute encapsulates a struct attribute, and it's handled
> the same way as the other attribute types (I modelled it after
> struct bin_attribute), and I don't see any places that I missed.
>
> When setting up the relay attribute, it's just a matter of:
>
> static struct relay_attribute dev_relay_attr = {
> .attr = {
> .owner = THIS_MODULE,
> ...
> },
> ...
> };
>
> Let me know if I've missed anything.

No, you are right, just wanted to make sure that the .owner stuff is
there.

One thing to note, a lot of people forgot to set that field for binary
attribute files, while "normal" attributes get it set "automatically"
due to the macro that was used to create them. You might consider also
creating a macro for this struture so people can not forget to set the
field.

thanks,

greg k-h
-
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/