Basic System Problem Analysis - August 2003
18
File System Structures: continued
The GUFD structure is also retained in most cases when a process closes a file. In other
words, if a process is the last accessor of a disk file and closes it we do not release the
GUFD rather it is appended to a least recently used (LRU) list. If the file is re-opened
chances are the GUFD will be on that list and we can simply pull it off the LRU and use
it making the file open process quicker.
The GUFD structure contains the virtual address of the file. There’s also the GDPD
pointer which is the end of a linked list of GDPD’s associated with the file.
If the file is attached to XM that will tracked in the GUFD.
Finally, the GUFD contains information taken from the file label, things such as the EOF
offset and number of records, the number of readers and writers. The GUFD also contains
the pointer to the file label. (Technically the file label is not a file system structure, it is
part of label management.)
The file label is an address that ends in $20 and the reason for that is that the FLAB_T
type is part of a slightly larger structure “T_FILE_LABEL_ENTRY”. This larger
structure contains components of what will become the UFID or Unique File Identifier of
a file (type is “UFID_TYPE”). And it also contains an offset to the extent block for the
file. Replacing the $20 from a file label pointer with $00 allows it to be formatted using
the “T_FILE_LABEL_ENTRY” type. This type is a boolean variant and it has the less-
than-useful variant first so proper formatting requires specifying the TRUE variant, for
example:
$1f8 ($70) nmdat > fv 15f.fc600 't_file_label_entry,TRUE'
Extent blocks migrate away from the file label as the file grows and more extents are
added. The most recent extent block is always kept adjacent to the file label. Extent
blocks are formatted with the type “T_EXTENT_BLOCK_ENTRY” which also suffers
from the less-than-useful-variant-first problem so formatting with this type also requires
the use of the TRUE variant. Each extent block will contain a pointer to the next extent
block, if there is one. And it’s worth noting too that all references to disks are volume
ID’s and not LDEV’s.