From: Erik Mouw <J.A.K.Mouw@its.tudelft.nl>
To: David Anderson <david-ander2023@mail.com>, linux-kernel@vger.kernel.org
Subject: Re: Reading a file in the driver
Date: Sun, 29 Dec 2002 16:24:52 +0100 [thread overview]
Message-ID: <20021229162452.A3412@it.et.tudelft.nl> (raw)
In-Reply-To: <20021227151332.26696.qmail@mail.com>; from David Anderson on Fri, Dec 27, 2002 at 10:13:32AM -0500
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/
prev parent reply other threads:[~2002-12-29 15:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-27 15:13 David Anderson
2002-12-29 15:24 ` Erik Mouw [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021229162452.A3412@it.et.tudelft.nl \
--to=j.a.k.mouw@its.tudelft.nl \
--cc=david-ander2023@mail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome