Re: question about configfs_attribute

2012-12-07 Thread Joel Becker
On Mon, Oct 15, 2012 at 01:45:56PM +0200, Constantine Shulyupin wrote:
> Hi
> 
> I wonder why show and store methods are not stored inside of
> configfs_attribute but stored in wrapper struct defined with
> CONFIGFS_ATTR_STRUCT ?

If you created a custom attribute struct and methods for
yourself, you would not have to have the show/store methods on the same
structure.  The structure, and the ##item_show/store macros, are a
convenience way to do it.
It certainly could be done differently.  I cloned the sysfs
approach at the time.  Note that sysfs has a different methodology for
defining attributes now.

Joel

-- 

Life's Little Instruction Book #252

"Take good care of those you love."

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


Re: question about configfs_attribute

2012-12-07 Thread Joel Becker
On Mon, Oct 15, 2012 at 01:45:56PM +0200, Constantine Shulyupin wrote:
 Hi
 
 I wonder why show and store methods are not stored inside of
 configfs_attribute but stored in wrapper struct defined with
 CONFIGFS_ATTR_STRUCT ?

If you created a custom attribute struct and methods for
yourself, you would not have to have the show/store methods on the same
structure.  The structure, and the ##item_show/store macros, are a
convenience way to do it.
It certainly could be done differently.  I cloned the sysfs
approach at the time.  Note that sysfs has a different methodology for
defining attributes now.

Joel

-- 

Life's Little Instruction Book #252

Take good care of those you love.

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