mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rob van Nieuwkerk <robn@verdi.et.tudelft.nl>
To: linux-kernel@vger.kernel.org
Subject: O_DIRECT alignment requirements ?
Date: Wed, 9 Apr 2003 14:16:08 +0200	[thread overview]
Message-ID: <20030409141608.A12136@verdi.et.tudelft.nl> (raw)

Hi all,

I plan to use O_DIRECT in my application (on a partition, no fs).
It is hard to find info on the exact requirements on the mandatory
alignments of buffer, offset, transfer size: it's easy to find many
contradicting documents.  And checking the kernel source itself isn't
trivial.

lseek(int fildes, off_t offset, int whence);
read(int fd, void *buf, size_t count);

My current assumption is this:

	- offset must be block_aligned (multiple of 512)
	- buf must be page_aligned (4096 on IA32)
	- count must be "block_aligned" (multiple of 512)

Is this correct ?

	r.

sysinfo:
--------
- Linux 2.4 (recent versions)
- using raw partion, no files, no fs
- IA32

             reply	other threads:[~2003-04-09 12:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-09 12:16 Rob van Nieuwkerk [this message]
2003-04-09 15:48 ` Joel Becker
2003-04-09 16:53   ` Rob van Nieuwkerk
2003-04-09 17:59     ` Joel Becker
2003-04-09 19:15     ` Andrew Morton
2003-04-09 21:09       ` Rob van Nieuwkerk
2003-04-09 23:27         ` Joel Becker
2003-04-10 16:33           ` Rob van Nieuwkerk
2003-04-09 18:08   ` Benjamin LaHaise

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=20030409141608.A12136@verdi.et.tudelft.nl \
    --to=robn@verdi.et.tudelft.nl \
    --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®