Installation guide
In this example, the command sets the directio flag on the file named datafile in directory /
gfs1.
gfs_tool setflag directio /gfs1/datafile
7.3. GFS Directory Attribute
The gfs_tool command can be used to assign (set) a direct I/O attribute flag, inherit_directio,
to a GFS directory. Enabling the inherit_directio flag on a directory causes all newly created
regular files in that directory to automatically inherit the directio flag. Also, the inher-
it_directio flag is inherited by any new subdirectories created in the directory. The inher-
it_directio flag can also be cleared.
Usage
Setting the inherit_directio flag
gfs_tool setflag inherit_directio Directory
Clearing the inherit_directio flag
gfs_tool clearflag inherit_directio Directory
Directory
Specifies the directory where the inherit_directio flag is set.
Example
In this example, the command sets the inherit_directio flag on the directory named /
gfs1/data/.
gfs_tool setflag inherit_directio /gfs1/data/
8. Data Journaling
Ordinarily, GFS writes only metadata to its journal. File contents are subsequently written to disk
by the kernel's periodic sync that flushes file-system buffers. An fsync() call on a file causes the
file's data to be written to disk immediately. The call returns when the disk reports that all data is
safely written.
Data journaling can result in a reduced fsync() time, especially for small files, because the file
data is written to the journal in addition to the metadata. An fsync() returns as soon as the data
is written to the journal, which can be substantially faster than the time it takes to write the file
data to the main file system.
Applications that rely on fsync() to sync file data may see improved performance by using data
journaling. Data journaling can be enabled automatically for any GFS files created in a flagged
7.3. GFS Directory Attribute
29