lkml.org 
[lkml]   [2003]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectDIRECT IO for ext3/ext2.
Date
From
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:58    [W:0.068 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site