* [patch] open.2: Update note about the alignment of the user buffer and the file offset for O_DIRECT flag
@ 2014-04-22 17:21 Peter Schiffer
[not found] ` <5356A50F.4010602-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Peter Schiffer @ 2014-04-22 17:21 UTC (permalink / raw)
To: Michael Kerrisk; +Cc: linux-man, esandeen-H+wXaHxf7aLQT0dZR+AlfA
[-- Attachment #1: Type: text/plain, Size: 377 bytes --]
Hello Michael,
the sentence in open(2) man page in notes for O_DIRECT flag:
"Under Linux 2.6, alignment to 512-byte boundaries suffices."
is not universally correct. The alignment is a property of the storage,
for example, 4k-sector drives with no 512 byte sector emulation will be
unable to perform 512-byte direct I/O.
The patch clarifies this sentence.
Thanks,
peter
[-- Attachment #2: open.2.patch --]
[-- Type: text/x-patch, Size: 695 bytes --]
diff --git a/man2/open.2 b/man2/open.2
index 389945f..c80686d 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -1322,7 +1322,16 @@ operation in
Under Linux 2.4, transfer sizes, and the alignment of the user buffer
and the file offset must all be multiples of the logical block size
of the filesystem.
-Under Linux 2.6, alignment to 512-byte boundaries suffices.
+Under Linux 2.6 and newer, alignment to the logical block size of the
+underlying storage (typically 512 bytes) suffices.
+Logical block size can be determined with
+.BR ioctl (2)
+.B BLKSSZGET
+system call or
+.BR blockdev (8)
+command with
+.B --getss
+parameter.
.LP
.B O_DIRECT
I/Os should never be run concurrently with the
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-22 18:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-22 17:21 [patch] open.2: Update note about the alignment of the user buffer and the file offset for O_DIRECT flag Peter Schiffer
[not found] ` <5356A50F.4010602-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-04-22 18:04 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).