From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Andreas Dilger <adilger@clusterfs.com>, linux-kernel@vger.kernel.org
Subject: Re: How can I force a read to hit the disk?
Date: Fri, 5 Sep 2003 21:09:02 +0200 [thread overview]
Message-ID: <20030905190902.GD24951@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0309051439560.678-100000@ida.rowland.org>
On Fri, 5 September 2003 14:49:15 -0400, Alan Stern wrote:
> On Fri, 5 Sep 2003, Andreas Dilger wrote:
>
> > If you open the file with O_DIRECT, it should read/write directly on the
> > disk, and it will also invalidate any existing cache for the read/written
> > area.
>
> Unfortunately that's not a good solution for me. The file has already
> been opened without O_DIRECT, and O_DIRECT wouldn't be appropriate because
> most of the time I do want I/O to go through the cache. It's just on a
> few rare occasions that I need direct access to the disk.
>
> Maybe simply opening a new struct file using O_DIRECT, for purposes of
> the verification, while keeping the old struct file around for other uses
> later, will work? That would be awkward though -- and there's no
> guarantee that the original filename would still exist. It would be a lot
> nicer to do everything using the original file reference.
Maybe these help you here:
man 3 fdopen
man 3 fileno
No filename needed for the second open.
Jörn
--
"Error protection by error detection and correction."
-- from a university class
next prev parent reply other threads:[~2003-09-05 19:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-05 17:46 Alan Stern
2003-09-05 18:15 ` Andreas Dilger
2003-09-05 18:49 ` Alan Stern
2003-09-05 19:09 ` Jörn Engel [this message]
2003-09-05 19:56 ` Alan Stern
2003-09-05 20:12 ` Alan Stern
2003-09-08 19:22 ` Alan Stern
2003-09-08 19:42 ` Richard B. Johnson
2003-09-08 20:36 ` Alan Stern
2003-09-09 12:13 ` Richard B. Johnson
2003-09-09 13:56 ` Alan Stern
2003-09-09 14:51 ` Richard B. Johnson
2003-09-09 20:16 ` Alan Stern
2003-09-05 18:42 ` Richard B. Johnson
2003-09-05 19:16 ` Alan Stern
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=20030905190902.GD24951@wohnheim.fh-wedel.de \
--to=joern@wohnheim.fh-wedel.de \
--cc=adilger@clusterfs.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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
all inboxes | Powered by JetHome®