Basic System Problem Analysis - August 2003

17
File System Structures
These structures are but the tip of the iceberg when it comes to the file system!
The PLFD is a file handle, whenever a process has a file or socket or pipe opened that
entity will occupy a slot in the PLFD table.
The PLFD structure will contain pointers to the GDPD for the file and to the GUFD for
the file, if there is one. The PLFD is also where we keep the “type manager control
block” which is an area used by the type manager bound to the file at open-time. The type
manager’s PLABEL” (code address) is also kept in the PLFD. Note that this field is
usually stored as a short pointer and as a result may be represented for example as
“eaca68.0”. This is really “a.eaca68” and can be displayed via “dcs eaca68”.
The macro FS_PLFD can be used to return the PLFD pointer for a given file number
associated with a particular pin, for example format the PLFD for file #11 ($b) for the
current pin:
$1e5 ($21d) nmdat > fv fs_plfd(,b) 'plfd_t'
The FS_FILE macros is quite useful for formatting all of the more important areas of the
PLFD structure. Like the FS_PLFD macro it takes both a PIN and file number as input.
The GDPD is where we keep the current pointers for a file and it is also where we keep
the “storage management control block”. The tail end of the GDPD has an SM_CB which
is used by storage management to know how to prefetch information from a disk file and
where to write information back to the file. Software updates the SM_CB prior to
initiating a read from disk or a write to disk.
Files that are not opened MULTI or GMULTI will have their own unique GDPD. Files
opened MULTI or GMULTI will, of course, share one. The linkage will be through the
NEXT_PLFD field in the PLFD.
The GUFD structure exists only for disk files, so it is normal to find files that do not have
a GUFD. All disk files had better have one!
Technically the GUFD is not a file system structure, it is actually part of storage
management. Additionally the GUFD is kept immediately adjacent to the “VSOD”
structure in the VSM “VSOD/GUFD Table” which will be discussed a bit later.