mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter T. Breuer" <ptb@it.uc3m.es>
To: linux kernel <linux-kernel@vger.kernel.org>
Cc: Thunder from the hill <thunder@lightweight.ods.org>
Subject: Re: block device/VM question
Date: Wed, 28 Aug 2002 16:38:50 +0200 (MET DST)	[thread overview]
Message-ID: <200208281438.g7SEcoQ22578@oboe.it.uc3m.es> (raw)
In-Reply-To: From "(env:" "ptb)" at "Aug 27, 2002 09:28:42 pm"

"A month of sundays ago ptb wrote:"
> "A month of sundays ago Thunder from the hill wrote:"
> > > And for the O_DIRECT flag we seem to do alloc_kiovec(1, &f->f_iobuf).
> > 
> > Perhaps we should go biovec here?

State of play:

1) I abandoned doing the dentry_open with O_DIRECT flags bit
from within the driver, because every external access then errored
with EINVAL without getting to my driver functions.

2) I then just tried opening the device normally from userspace
but with O_DIRECT set. This is harder than it should have been - I had
to set nearly everything in features.h on before I got the desired
compilation (was it _XOPEN_SOURCE that did it? I forget), and surprise,
surprise, I get exactly the same effects as in (1). Every access
errors with EINVAL and my driver code never gets called. An open
with code compiled without O_DIRECT works fine, as usual.

I put a little debugging in the driver open call. With O_DIRECT
in the userspace open:

#881[12]: _open have O_DIRECT iobuf 0xcf935000 for part 0
#883[12]: _open have i_mapping 0xcce7f874 for part 0
#885[12]: _open have a_ops 0xc029ef40 for part 0
#889[12]: _open have direct_IO 0xc013edc0 for part 0

(I presume the latter is generic_file_direct_IO - it's not in my
map, but it's static so shouldn't be).

and without:

#881[14]: _open have ~O_DIRECT iobuf 0x0 for part 0
#883[14]: _open have i_mapping 0xcce7f874 for part 0
#885[14]: _open have a_ops 0xc029ef40 for part 0
#889[14]: _open have direct_IO 0xc013edc0 for part 0

So it looks as though some driver cooperation is required in
order for direct_IO/O_DIRECT to work.

What? Anyone know?


Peter

             reply	other threads:[~2002-08-28 14:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-28 14:38 Peter T. Breuer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-08-29  5:45 Peter T. Breuer
2002-08-27 18:40 Peter T. Breuer
     [not found] <Pine.LNX.4.44.0208271118000.3234-100000@hawkeye.luckynet.adm>
2002-08-27 18:04 ` Peter T. Breuer
2002-08-27 19:13   ` Thunder from the hill
2002-08-27 19:28     ` Peter T. Breuer
     [not found] <Pine.LNX.4.44.0208271100460.3234-100000@hawkeye.luckynet.adm>
2002-08-27 17:12 ` Peter T. Breuer
     [not found] <Pine.LNX.4.44.0208271021020.3234-100000@hawkeye.luckynet.adm>
2002-08-27 16:32 ` Peter T. Breuer
2002-08-27 16:42   ` Thunder from the hill
2002-08-27 16:57     ` Peter T. Breuer
2002-08-27 11:28 Peter T. Breuer
2002-08-27  8:58 Peter T. Breuer
2002-08-27 16:06 ` Thunder from the hill
2002-08-27 16:14   ` Peter T. Breuer

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=200208281438.g7SEcoQ22578@oboe.it.uc3m.es \
    --to=ptb@it.uc3m.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thunder@lightweight.ods.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®