![]() |
![]() |
Because the filespace is so important to the operation of the system, a separate set of calls is used to register, update, and delete filespace identifiers. Before you can store any objects that are associated with a filespace on the system, you must first register the filespace with TSM. Use the dsmRegisterFS call to accomplish this task. See Identifying the Object for more information.
The filespace identifier is the top-level qualifier in a three-part name hierarchy. Grouping related data together within a filespace makes management of that data much easier. For example, either the application client or the TSM server administrator can delete a filespace and all the objects within that filespace.
Filespaces also permit the application client to provide information about
the filespace to the server that the TSM administrator can then query.
This information is returned on the query in the qryRespFSData
structure and includes:
Type | Definition |
---|---|
fstype | The filespace type. This field is a character string that the application client sets. |
fsAttr[platform].fsInfo | A client information field used for client-specific data. |
capacity | The total amount of space in the file space. |
occupancy | The amount of space currently occupied in the file space. |
backStartDate | The time stamp when the latest backup started (set by sending a dsmUpdateFS call). |
backCompleteDate | The time stamp when the latest backup completed (set by sending a dsmUpdateFS call). |
Using capacity and occupancy depends on the application client. Some applications might not need information about the size of the file space, in which case these fields can default to zero. See Querying the TSM System for more information about querying file spaces.
After a file space is registered with the system, you can back up or archive objects at any time. We recommend that you call dsmUpdateFS to update the occupancy and the capacity fields of the file space after a backup or archive operation. This ensures that the values for the occupancy and capacity of the file system are current. You can also update the fsinfo, backupstart, and backupcomplete fields.
If you want to monitor your last backup dates, enter a dsmUpdateFS call before starting your backup. Set the update action to DSM_FSUPD_BACKSTARTDATE. This will force the server to set the backStartDate field of the file space to the current time. After the backup is complete for that file space, enter a dsmUpdateFS call with the update action that is set to DSM_FSUPD_BACKCOMPLETEDATE. This will time stamp the end of the backup.
If a file space is no longer needed, you can delete it with the dsmDeleteFS command. On the UNIX platform, only the root user or TSM-Authorized user can delete file spaces.
The examples in Figure 5 demonstrate how to use the three filespace calls for UNIX. For an example of how to use the three filespace calls for Intel, see the sample program code installed on your system.
Figure 5. An Example of Working With File Spaces, Part 1
+--------------------------------------------------------------------------------+ |/* Register the file space if it has not already been done. */ | | | |dsInt16 rc; | |regFSData fsData; | |char fsName[DSM_MAX_FSNAME_LENGTH]; | |char smpAPI[] = "Sample-API"; | | | |strcpy(fsName,"/home/tallan/text"); | |memset(&fsData,0x00,sizeof(fsData)); | |fsData.stVersion = regFSDataVersion; | |fsData.fsName = fsName; | |fsData.fsType = smpAPI; | |strcpy(fsData.fsAttr.unixFSAttr.fsInfo,"Sample API FS Info"); | |fsData.fsAttr.unixFSAttr.fsInfoLength = | | strlen(fsData.fsAttr.unixFSAttr.fsInfo) + 1; | |fsData.occupancy.hi=0; | |fsData.occupancy.lo=100; | |fsData.capacity.hi=0; | |fsData.capacity.lo=300; | | | |rc = dsmRegisterFS(dsmHandle,fsData); | |if (rc == DSM_RC_FS_ALREADY_REGED) rc = DSM_RC_OK; /* already done */ | |if (rc) | |{ | | printf("Filespace registration failed: "); | | rcApiOut(dsmHandle, rc); | | free(bkup_buff); | | return (RC_SESSION_FAILED); | |} | +--------------------------------------------------------------------------------+
Figure 6. An Example of Working With File Spaces, Part 2
+--------------------------------------------------------------------------------+ | | |/* Update the file space. */ | | | |dsmFSUpd updFilespace; /* for update FS */ | | | |updFilespace.stVersion = dsmFSUpdVersion; | |updFilespace.fsType = 0; /* no change */ | |updFilespace.occupancy.hi = 0; | |updFilespace.occupancy.lo = 50; | |updFilespace.capacity.hi = 0; | |updFilespace.capacity.lo = 200; | |strcpy(updFilespace.fsAttr.unixFSAttr.fsInfo, | | "My update for filespace") ; | |updFilespace.fsAttr.unixFSAttr.fsInfoLength = | | strlen(updFilespace.fsAttr.unixFSAttr.fsInfo); | | | |updAction = DSM_FSUPD_FSINFO | | | DSM_FSUPD_OCCUPANCY | | | DSM_FSUPD_CAPACITY; | | | |rc = dsmUpdateFS(handle,fsName,&updFilespace,updAction); | |printf("dsmUpdateFS rc=%d\n", rc); | | | +--------------------------------------------------------------------------------+
Figure 7. An Example of Working With File Spaces, Part 3
+--------------------------------------------------------------------------------+ | | |/* Delete the file space. */ | | | |printf("\nDeleting file space %s",fsName); | |rc = dsmDeleteFS(dsmHandle,fsName,DSM_REPOS_ALL); | |if (rc) | |{ | | printf(" FAILED!!! "); | | rcApiOut(dsmHandle, rc); | |} | |else printf(" OK!\n"); | +--------------------------------------------------------------------------------+