* Reading a file in the driver
@ 2002-12-27 15:13 David Anderson
2002-12-29 15:24 ` Erik Mouw
0 siblings, 1 reply; 2+ messages in thread
From: David Anderson @ 2002-12-27 15:13 UTC (permalink / raw)
To: linux-kernel
Hi,
I am reading some data from a file byte by byte in my driver. Although it's not a good thing to read a file in the driver I have to do it. My file is quite big can contain about 1000 lines each line containing anywhere from 0 to 500 characters. I believe carry out 500000 reads is not a good thing.
Any suggestions on how I can improve ??
Thanks and Regards,
David
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
Meet Singles
http://corp.mail.com/lavalife
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Reading a file in the driver
2002-12-27 15:13 Reading a file in the driver David Anderson
@ 2002-12-29 15:24 ` Erik Mouw
0 siblings, 0 replies; 2+ messages in thread
From: Erik Mouw @ 2002-12-29 15:24 UTC (permalink / raw)
To: David Anderson, linux-kernel
On Fri, Dec 27, 2002 at 10:13:32AM -0500, David Anderson wrote:
> I am reading some data from a file byte by byte in my driver. Although it's not a good thing to read a file in the driver I have to do it. My file is quite big can contain about 1000 lines each line containing anywhere from 0 to 500 characters. I believe carry out 500000 reads is not a good thing.
>
> Any suggestions on how I can improve ??
Sure, do it from userland. Make a device node to which userland can write
the file you want. This nicely removes the policy problem of *which* file
to read from *what* location and puts it were it belongs: userland. With
this setup you can even read files from such exotic locations like other
servers or SQL databases.
If the driver needs to initiate the file reading, just startup a userland
helper that does the reads for you. See for example how the hotplug
subsystem calls /sbin/hotplug.
Erik
--
J.A.K. (Erik) Mouw
J.A.K.Mouw@its.tudelft.nl mouw@nl.linux.org
http://www-ict.its.tudelft.nl/~erik/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-29 15:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-27 15:13 Reading a file in the driver David Anderson
2002-12-29 15:24 ` Erik Mouw
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.