[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to know the file size limit, and know if O_DIRECT is supported
----- Original Message -----
From: "Manish Regmi" <regmi.manish@xxxxxxxxx>
To: "colin" <colin@xxxxxxxxxxxxxx>
Cc: <kernelnewbies@xxxxxxxxxxxx>
Sent: Friday, December 22, 2006 1:26 PM
Subject: Re: How to know the file size limit, and know if O_DIRECT is
supported
> On 12/22/06, colin <colin@xxxxxxxxxxxxxx> wrote:
> >
> > Hi Erik,
> > My colleague said that when use direct I/O on USB disk that has a ext3
> > partition, open can succeed, but read fails.
> > I know that filesystem must have some system calls for direct I/O, and
open
> > with O_DIRECT flag will check if these system calls exist.
> > But why does read fail? Is it that direst I/O cannot use on USB disk?
>
> Have you aligned the buffers correctly. Read/Write will fail if buffer
> is not aligned in sector boundry.
>
I have tested this by myself and I found that direct I/O can work on USB
disk.
My colleage didn't align the buffer.
Thanks,
Colin
> --
> ---------------------------------------------------------------
> regards
> Manish Regmi
>
> ---------------------------------------------------------------
> UNIX without a C Compiler is like eating Spaghetti with your mouth
> sewn shut. It just doesn't make sense.
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/