Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
OSS Porting Considerations
Open System Services Porting Guide520573-006
6-19
Opening an OSS File
Opening an OSS File
A file open operation for an OSS file involves a number of steps. If the file specified in
the open request does not exist, it is created (if the O_CREATE flag is set). The
following steps are involved in opening an OSS file:
1. An application uses the open() function call to open an OSS file named /a/b.
The OSS file system sends an open request to the OSS name server.
2. The OSS name server receives the open request and attempts to map the OSS
pathname to a Guardian filename. This mapping step involves a file lookup step
with the catalog.
3. The OSS name server replies to the client with a filename in the Guardian filename
format ($DATA.ZYQ00000.Z000002H). Accessing the catalog (involving a disk
access) is not done when opening a Guardian file. (Because of the caching in the
OSS name server, catalog access during open processing might not be needed.)
4. Now equipped with a Guardian filename, the OSS file system sends an OSS open
message to the appropriate DP2 disk process.
This process and the related closes can involve many resources when done for many
files. See Performance Considerations for Files on page 6-20 for conserving system
resources.
Extra Steps for Creating Files
The extra steps for opening OSS files involve the pathnames translation performed by
the OSS name server. The catalog accessed is an Enscribe database describing the
files in the fileset. Each OSS fileset has a catalog. For the OSS fileset, each OSS file
has an entry in a catalog, as does each filename.
Creating a file involves a few more steps than opening an existing OSS file. Similar to
opening a file, the application (client) sends an open request to the OSS name server,
which determines that the file does not exist. The OSS name server picks a volume
and creates a file by sending an OSS create call to the DP2 disk process; it creates a
catalog entry for the file and responds to the application with the created filename. The
application then can open this file by sending an OSS open request to the DP2 disk
process.