mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <dhruv.anand@wipro.com>
To: <linux-kernel@vger.kernel.org>
Cc: <akpm@zip.com.au>, <janetinc@us.ibm.com>, <akpm@zip.com.au>,
	<pbadari@us.ibm.com>, <nathans@sgi.com>
Subject: DIRECT IO for ext3/ext2.
Date: Fri, 21 Nov 2003 21:23:06 +0530	[thread overview]
Message-ID: <1E27FF611EBEFB4580387FCB5BEF00F3013DEEE8@blr-ec-msg04.wipro.com> (raw)

Hi,
I am working on an application on linux-2.6 that needs to
bypass the buffer cache. In order to do so i use the direct
IO functionality. Although open to the device succeeds with
the DIRECT_IO flag, read from the device fails.

Following is the exceprt fromt he code to open and read;
--------------------------------------------------------

if ((devf = open(dumpdev, O_RDONLY | O_DIRECT, 0)) < 0) {
     fprintf(KL_ERRORFP, "Error: open failed!\n");
     ...
}

if(err = read(devf, &magic_nr, sizeof(magic_nr)) != sizeof(magic_nr)) {
     fprintf(KL_ERRORFP, "Error: read() failed!\n");
      ...
}

---------------------------------------------------------
I am returned an errno=22, indicating 'Invalid argument'

I would appreciate it, if you could knowledge me importantly about
the completeness of the 'direct IO' functionality in ext3 file-system.
Or if i am doing something wrong in usage?


Regards
Dhruv.

             reply	other threads:[~2003-11-21 15:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-21 15:53 dhruv.anand [this message]
2003-11-21 17:40 ` Andrew Morton
2003-11-21 19:30 dhruv.anand
2003-11-21 19:45 ` Andrew Morton
2003-11-25  8:16 ` Michael Kerrisk

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=1E27FF611EBEFB4580387FCB5BEF00F3013DEEE8@blr-ec-msg04.wipro.com \
    --to=dhruv.anand@wipro.com \
    --cc=akpm@zip.com.au \
    --cc=janetinc@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathans@sgi.com \
    --cc=pbadari@us.ibm.com \
    /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®