mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter T. Breuer" <ptb@it.uc3m.es>
To: kernel@street-vision.com
Cc: linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: O_DIRECT
Date: Thu, 29 Aug 2002 13:22:41 +0200 (MET DST)	[thread overview]
Message-ID: <200208291122.g7TBMfa05527@oboe.it.uc3m.es> (raw)
In-Reply-To: <200208291113.g7TBDut26852@tench.street-vision.com> from "kernel@street-vision.com" at "Aug 29, 2002 11:13:56 am"

"A month of sundays ago kernel@street-vision.com wrote:"
> > What functions does a block driver have to implement in order to
> > support read/write when it has been opened with O_DIRECT from user
> > space.
> > 
> > I have made some experiments with plain read/write after opening with 
> > O_DIRECT:
> > 
> > 2.5.31:
> >    /dev/ram0      open fails
> >    file on ext2   r/w gives EINVAL
> >    /dev/hdaN      works
> > 
> > 2.4.19:
> >    /dev/ram0      r/w gives EINVAL
> >    file on ext2   r/w gives EINVAL
> >    /dev/hdaN      r/w gives EINVAL
> > 
> > WTF? It's not a library issue - strace shows the syscalls happening
> > with the right flag set on the open.
> 
> You should be able to get it to work on ext2. It works fine for me.
> Remeber that the memory you read/write from must be page aligned (ie
> mmap /dev/zero not malloc) and reads and writes must be multiples of the
> page size. I think block devices work on 2.4 too, but I forget (otherwise
> you can use raw devices).

Thanks for the input. Well, I used the same test program on all, and
the buffer was aligned at 512 bytes (because I intended it to work
with raw character devices too). You are saying that it was luck .. OK,
I'll retest in a little while.

So I simply have to do "nothing" in the driver?

Peter

       reply	other threads:[~2002-08-29 11:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200208291113.g7TBDut26852@tench.street-vision.com>
2002-08-29 11:22 ` Peter T. Breuer [this message]
2002-08-29 12:14 ` O_DIRECT Peter T. Breuer
2004-07-20 17:27 O_DIRECT Shesha Sreenivasamurthy
2004-07-20 18:48 ` O_DIRECT bert hubert
     [not found]   ` <40FD6FCB.5020408@inostor.com>
2004-07-20 20:17     ` O_DIRECT bert hubert
2004-07-21  0:10   ` O_DIRECT Rob van Nieuwkerk
2004-07-21 14:45   ` O_DIRECT Devel
     [not found]     ` <40FE9F3F.2090205@inostor.com>
2004-07-22  9:46       ` O_DIRECT Devel
2004-07-24  9:56   ` O_DIRECT Rogier Wolff
2004-07-26  1:24     ` O_DIRECT Andrew Morton
2004-07-21  0:05 ` O_DIRECT Rob van Nieuwkerk
     [not found]   ` <40FEA382.8050700@inostor.com>
2004-07-21 17:20     ` O_DIRECT Rob van Nieuwkerk
     [not found]       ` <40FEAF70.4070407@inostor.com>
2004-07-21 18:15         ` O_DIRECT Rob van Nieuwkerk
2004-07-21 18:45           ` O_DIRECT Shesha Sreenivasamurthy
2004-07-21 23:18           ` O_DIRECT Shesha Sreenivasamurthy
2004-07-21 23:54             ` O_DIRECT Rob van Nieuwkerk
2004-07-22  0:00               ` O_DIRECT Shesha Sreenivasamurthy
2004-07-22  0:18                 ` O_DIRECT Rob van Nieuwkerk
2004-07-22  0:48                   ` O_DIRECT Shesha Sreenivasamurthy
     [not found] <200306262021.h5QKLhN10771@devserv.devel.redhat.com>
     [not found] ` <1056706819.2418.11.camel@sisko.scot.redhat.com>
2003-06-27 10:35   ` O_DIRECT Stephen C. Tweedie
2003-06-27 11:07     ` O_DIRECT Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-08-29 11:04 O_DIRECT Peter T. Breuer
2001-04-12 21:09 O_DIRECT Andrea Arcangeli

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=200208291122.g7TBMfa05527@oboe.it.uc3m.es \
    --to=ptb@it.uc3m.es \
    --cc=kernel@street-vision.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®