lkml.org 
[lkml]   [2006]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Right way to configure a driver? (sysfs, ioctl, proc, configfs,....)
On Mon, Jan 30, 2006 at 12:23:14PM +0100, Aritz Bastida wrote:
> Thank you Antonio and Greg
> But I still have one question pending:
>
> > >
> > > 3.- Actually the most difficult config I must do is to pass three
> > > values from userspace to my module. Specifically two integers and a
> > > long (it's an offset to a memory zone I've previously defined)
> > >
> > > struct meminfo {
> > > unsigned int id; /* segment identifier */
> > > unsigned int size; /* size of the memory area */
> > > unsigned long offset; /* offset to the information */
> > > };
> > >
> > > How would you pass this information in sysfs? Three values in the same
> > > file? Note that using three different files wouldn't be atomic, and I
> > > need atomicity.
> > >
>
> I guess I could pass three values on the same file, like this:
> $ echo "5 1000 500" > meminfo
>
> I know that breaks the sysfs golden-rule, but how can I pass those
> values _atomically_ then? Having three different files wouldn't be
> atomic...

That's what configfs was created for. I suggest using that for things
like this, as sysfs is not intended for it.

thanks,

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

\
 
 \ /
  Last update: 2006-01-30 22:41    [W:0.098 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site