[B.A.T.M.A.N.] [PATCH 13/26] staging:batman-adv: convert multiple /proc files to use sysfs

Marek Lindner lindner_marek at yahoo.de
Thu May 13 01:51:05 CEST 2010

On Thursday 13 May 2010 03:17:20 Greg KH wrote:
> > This makes invalid entries in sysfs not better, but maybe helps you to
> > get in the correct mood to point us in the right direction.
> I honestly don't care about older kernels, as this is all about merging
> the code into the current kernel version, not older ones :)

In addition to our our efforts of merging the code into the current version we 
offer a backward compatible module (similar to wireless-compat) which also 
works on older kernels. We would very much prefer if everybody simply used the 
latest kernel but the world is not as perfect as we wish it to be. Therefore, 
we always have to look back a bit.

> Yes, that should be quite simple.  The perf code does this today, you
> can just steal their function that handles this.  Almost all distros are
> mounting debugfs these days, so it's not really a big deal.

Debugfs looks like an option.

> The others are all single-value files, right?  Or did I miss something?
> If they are single-value files, then yes, they can stay in sysfs, unless
> you feel they are debug-type things, then debugfs is the place for them
> (debugfs makes is trivial to handle single value files, even easier than
> sysfs.)

Well, now that you mention it ..  :-)
Next to the sysfs interface batman creates a file in /dev (/dev/batman-adv at 
the moment) that is used to inject (debug) packets into the mesh from user 
space. Due to our ongoing mesh abstraction effort we would need to create one 
file per virtual mesh which is little bit messy in /dev (although doable). I'd 
like to get it out of there - can/should we move it to debugfs ? The initial 
reason to choose /dev was the ability get the open() and close() syscalls 
because we need to maintain a state for each user.


More information about the B.A.T.M.A.N mailing list