Direct I/O; O_Direct; Gfs File Attribute - Red Hat GFS 6.0 Administrator's Manual

Hide thumbs Also See for GFS 6.0:
Table of Contents

Advertisement

Chapter 9. Managing GFS

9.7. Direct I/O

Direct I/O is a feature of the file system whereby file reads and writes go directly from the applications
to the storage device, bypassing the operating system read and write caches. Direct I/O is used by only
a few applications that manage their own caches, such as databases.
Direct I/O is invoked by an application opening a file with the
can attach a direct I/O attribute to a file, in which case direct I/O is used regardless of how the file is
opened.
When a file is opened with
operations must be done in block-size multiples of 512 bytes. The memory being read from or written
to must also be 512-byte aligned.
One of the following methods can be used to enable direct I/O on a file:

O_DIRECT

GFS file attribute
GFS directory attribute
9.7.1.
O_DIRECT
If an application uses the
file.
To cause the
O_DIRECT
beginning of a source file before any includes, or define it on the cc line when compiling.
Note
Linux kernels from some distributions do not support use of the

9.7.2. GFS File Attribute

The
command can be used to assign a direct I/O attribute flag,
gfs_tool
GFS file. The
directio
9.7.2.1. Usage
Set Direct I/O Attribute Flag
gfs_tool setflag
Clear Direct I/O Attribute Flag
gfs_tool clearflag
File
Specifies the file where the
, or when a GFS direct I/O attribute is attached to a file, all I/O
O_DIRECT
flag on an
O_DIRECT
flag to be defined with recent glibc libraries, define
flag can also be cleared.
File
directio
File
directio
directio
system call, direct I/O is used for the opened
open()
flag is assigned.
flag. Alternatively, GFS
O_DIRECT
_GNU_SOURCE
flag.
O_DIRECT
directio
103
at the
, to a regular

Advertisement

Table of Contents
loading

Table of Contents