Thread (4 messages) 4 messages, 3 authors, 2002-11-27

Re: RE: [PATCH] drivers/acpi/ac.c: convert to seq_file

From: John Belmonte <hidden>
Date: 2002-11-27 20:02:53

quoted
From: Arnaldo Carvalho de Melo [mailto:acme-KCZ47A4bww4P48s/oLjRZg@public.gmane.org] 
Please consider pulling from:

bk://oops.kerneljanitors.org:acpi-2.5

This is the first in a series of changesets converting
ACPI to seq_file, please lets us know if something is unacceptable.

The work was done by Aristeu Rozanski.

Hi acme,

Looks like an improvement. My thanks to you and Aristeu.

Let me know when you're done with all the changesets and I'll pull
everything.

Regards -- Andy

This is coming too late, but I kind of object to these changes on the 
grounds that there is an oversight in the handling of userdata between 
proc_fs and seq_file.  Although the use of seq_file cleans up obscure 
proc read code, it also eliminates the option of writing proc handlers 
in an object-oriented style.

When I saw the seq_file patch to the toshiba_acpi module 
(http://linux.bkbits.net:8080/linux-2.5/patch-9BHYcwbM+ZDX/YFgETsMoA@public.gmane.org), my reaction 
was that things were now too verbose and redundant, and it was time for 
me to move to data-driven generic code.  I knew this option was 
available because proc_dir_entry carries a userdata field which is 
passed to all the handlers.  While seq_file also has userdata support, 
the problem is that proc_fs does not propegate its userdata to seq_file. 
  The only way to set the seq_file userdata is in the open handler, 
which as far as I can tell does not have access to the proc_dir_entry. 
The result is a proliferation of nearly-identical functions and tables 
that could otherwise be factored out.

In summary, what I'm looking for is a way to pass in a userdata at 
proc_dir_entry creation time, and have this data available in the read 
handler, without resorting to redundant tables and wrapper functions or 
macro trickery.  This was, after all, completly feasible prior to the 
use of seq_file.

If I've overlooked something please let me know, before I stick my foot 
in my mouth on the kernel list.


Regards,
-John



-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T 
handheld. Power & Color in a compact size! 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help