linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH] fs: configfs: programmatically create config groups
@ 2012-11-26  8:35 Andrzej Pietrasiewicz
  2012-11-26  8:35 ` [RFC][PATCH] fs: configfs: allow other kernel parts to " Andrzej Pietrasiewicz
                   ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: Andrzej Pietrasiewicz @ 2012-11-26  8:35 UTC (permalink / raw)
  To: linux-usb, linux-kernel
  Cc: Andrzej Pietrasiewicz, Kyungmin Park, Felipe Balbi,
	Greg Kroah-Hartman, Joel Becker, Sebastian Andrzej Siewior,
	Marek Szyprowski, Michal Nazarewicz

In some parts of the kernel (e.g. planned configfs integration into usb
gadget) there is a need to programmatically create config groups
(directories) but it would be preferable to disallow creating them by
the user. This is more or less what default_groups used to be for.
But e.g. in the mass storage gadget, after storing the number of
luns (logical units) into some configfs attribute, the corresponding lun#
directories should be created, their number is not known up front so
default_groups are no good for this.

Example:

$ echo 3 > /cfg/..../mass_storage/luns

causes

/cfg/....../mass_storage/lun0
/cfg/....../mass_storage/lun1
/cfg/....../mass_storage/lun2

to be created. Yet

$ mkdir /cfg/..../mass_storage/<any name>

should not be allowed.

With create_group exported it is very easily achieved: make_group and make_item
are set to NULL in mass_storage's config_group, yet the kernel can
create_groups at will.

I kindly ask for comments. In particular, I would like to discuss
if this is the right approach. A counterpart to remove config groups
is also required. It is not implemented in this patch, though. What are
your opinions?

Andrzej Pietrasiewicz (1):
  fs: configfs: allow other kernel parts to programmatically create
    config groups

 fs/configfs/dir.c        |    5 +++--
 include/linux/configfs.h |    2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2012-12-14 12:18 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-26  8:35 [RFC][PATCH] fs: configfs: programmatically create config groups Andrzej Pietrasiewicz
2012-11-26  8:35 ` [RFC][PATCH] fs: configfs: allow other kernel parts to " Andrzej Pietrasiewicz
2012-11-26 13:14 ` [RFC][PATCH] fs: configfs: " Michal Nazarewicz
2012-11-26 16:30 ` Sebastian Andrzej Siewior
2012-11-26 16:56   ` Michal Nazarewicz
2012-11-26 17:06     ` Sebastian Andrzej Siewior
2012-11-26 17:54       ` Michal Nazarewicz
2012-11-27 15:20         ` Sebastian Andrzej Siewior
2012-11-28  7:08           ` Nicholas A. Bellinger
2012-11-27  8:57   ` Andrzej Pietrasiewicz
2012-11-27 14:32     ` Michal Nazarewicz
2012-11-27 15:59     ` Sebastian Andrzej Siewior
2012-11-27 16:23       ` Michal Nazarewicz
2012-11-28  8:15         ` Sebastian Andrzej Siewior
2012-11-28 13:05           ` Michal Nazarewicz
2012-11-28 13:50             ` Sebastian Andrzej Siewior
2012-11-28 14:24               ` Michal Nazarewicz
2012-11-28 18:52                 ` Sebastian Andrzej Siewior
2012-12-07 23:18               ` Joel Becker
2012-12-10 11:57                 ` Andrzej Pietrasiewicz
2012-12-10 14:17                   ` Andrzej Pietrasiewicz
2012-12-10 14:34                     ` Felipe Balbi
2012-12-10 15:27                       ` Andrzej Pietrasiewicz
2012-12-12  1:10                     ` Joel Becker
2012-12-11 21:27                   ` Joel Becker
2012-12-14 12:18                 ` Sebastian Andrzej Siewior
2012-11-28  8:10       ` Andrzej Pietrasiewicz
2012-11-28  8:38         ` Sebastian Andrzej Siewior
2012-11-28 14:09           ` Andrzej Pietrasiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).