Re: read failed EINVAL with O_DIRECT flag

2005-04-13 Thread Randy.Dunlap
On Wed, 13 Apr 2005 15:15:47 +0200 Yves Crespin wrote: | | >| How can I obtains an buffer alignement from a "user program" ? | > | >I actually left that as an exercise (after I did it at home | >last night). Did you read the hint (below)? | | Well ... either with malloc() and alignement or

Re: read failed EINVAL with O_DIRECT flag

2005-04-13 Thread Yves Crespin
>| How can I obtains an buffer alignement from a "user program" ? > >I actually left that as an exercise (after I did it at home >last night). Did you read the hint (below)? Well ... either with malloc() and alignement or posix_memalign(), read() still failed! My read buffer is in user space, so

Re: read failed EINVAL with O_DIRECT flag

2005-04-13 Thread Yves Crespin
| How can I obtains an buffer alignement from a user program ? I actually left that as an exercise (after I did it at home last night). Did you read the hint (below)? Well ... either with malloc() and alignement or posix_memalign(), read() still failed! My read buffer is in user space, so it's

Re: read failed EINVAL with O_DIRECT flag

2005-04-13 Thread Randy.Dunlap
On Wed, 13 Apr 2005 15:15:47 +0200 Yves Crespin wrote: | | | How can I obtains an buffer alignement from a user program ? | | I actually left that as an exercise (after I did it at home | last night). Did you read the hint (below)? | | Well ... either with malloc() and alignement or

Re: read failed EINVAL with O_DIRECT flag

2005-04-12 Thread Randy.Dunlap
On Tue, 12 Apr 2005 18:16:40 +0200 Yves Crespin wrote: | I've got compilation error when I call vmalloc() from a user program | (w/o defined __KENEL). Where did vmalloc() come from? I said malloc(), not vmalloc(). | How can I obtains an buffer alignement from a "user program" ? I actually

Re: read failed EINVAL with O_DIRECT flag

2005-04-12 Thread Yves Crespin
I've got compilation error when I call vmalloc() from a user program (w/o defined __KENEL). How can I obtains an buffer alignement from a "user program" ? Randy.Dunlap wrote: On Mon, 11 Apr 2005 21:14:17 +0200 Yves Crespin wrote: | Hello, | | Using O_DIRECT flag, read() failed and errno is

Re: read failed EINVAL with O_DIRECT flag

2005-04-12 Thread Yves Crespin
I've got compilation error when I call vmalloc() from a user program (w/o defined __KENEL). How can I obtains an buffer alignement from a user program ? Randy.Dunlap wrote: On Mon, 11 Apr 2005 21:14:17 +0200 Yves Crespin wrote: | Hello, | | Using O_DIRECT flag, read() failed and errno is

Re: read failed EINVAL with O_DIRECT flag

2005-04-12 Thread Randy.Dunlap
On Tue, 12 Apr 2005 18:16:40 +0200 Yves Crespin wrote: | I've got compilation error when I call vmalloc() from a user program | (w/o defined __KENEL). Where did vmalloc() come from? I said malloc(), not vmalloc(). | How can I obtains an buffer alignement from a user program ? I actually left

Re: read failed EINVAL with O_DIRECT flag

2005-04-11 Thread Randy.Dunlap
On Mon, 11 Apr 2005 21:14:17 +0200 Yves Crespin wrote: | Hello, | | Using O_DIRECT flag, read() failed and errno is EINVAL. | kernel 2.4.22 | Filesystem Ext3 mount on /home | What's wrong ? | Thanks In fs/buffer.c, it wants the buffer & the length (size) to be aligned: function: brw_kiovec()

read failed EINVAL with O_DIRECT flag

2005-04-11 Thread Yves Crespin
Hello, Using O_DIRECT flag, read() failed and errno is EINVAL. kernel 2.4.22 Filesystem Ext3 mount on /home What's wrong ? Thanks Yves Crespin #gcc -Wall -D_GNU_SOURCE direct.c -o direct #cp direct d #./direct d #open failed [d] 040402 0666 errno 22 # /* --- start code --- */ #include #include

read failed EINVAL with O_DIRECT flag

2005-04-11 Thread Yves Crespin
Hello, Using O_DIRECT flag, read() failed and errno is EINVAL. kernel 2.4.22 Filesystem Ext3 mount on /home What's wrong ? Thanks Yves Crespin #gcc -Wall -D_GNU_SOURCE direct.c -o direct #cp direct d #./direct d #open failed [d] 040402 0666 errno 22 # /* --- start code --- */ #include stdio.h

Re: read failed EINVAL with O_DIRECT flag

2005-04-11 Thread Randy.Dunlap
On Mon, 11 Apr 2005 21:14:17 +0200 Yves Crespin wrote: | Hello, | | Using O_DIRECT flag, read() failed and errno is EINVAL. | kernel 2.4.22 | Filesystem Ext3 mount on /home | What's wrong ? | Thanks In fs/buffer.c, it wants the buffer the length (size) to be aligned: function: brw_kiovec()