public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* O_DIRECT alignment requirements ?
@ 2003-04-09 12:16 Rob van Nieuwkerk
  2003-04-09 15:48 ` Joel Becker
  0 siblings, 1 reply; 9+ messages in thread
From: Rob van Nieuwkerk @ 2003-04-09 12:16 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-04-10 16:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-09 12:16 O_DIRECT alignment requirements ? Rob van Nieuwkerk
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox