From: James McGrath X3T9.2/91-56 Rev 0 Quantum Corporation 580 Cottonwood Ave Milpitas, CA 95035 To: John Lohmeyer Chairman, X3T9.2 3718 N. Rock Road Wichita, KS 67226 Date: April 22, 1991 Subject: New SCSI Commands for FFS (Flat File System) Purpose This is the first draft of a proposal to add a set of SCSI commands to implement a Flat File System. The changes required are confined to the command set, and do not affect mechanical, electrical, or messaging portions of the protocol. These additions are targeted for incorporation in SCSI-3. They are consistent with the already approved charge for a higher level command set that is not device specific. Background These commands allow the host to address the device using a file system model rather than a logical block model. This change in models hides many device specific characteristics and allows the migration of some file system functions into the device. Possible functions that the device may assume include: data compression (easier than in a block interface) file caching data migration (for subsystems containing disk and tape) The following functions will still be the responsibility of the host system: directory structure file access protection file naming Proposal Add a file system device model to the models section. A file system consists of one or more files. Each file is composed of logical blocks. The number of logical blocks per file may differ from file to file within the same file system. A device may contain one of more file systems. No file system may span more than one device. Each file system shall be identified by a File_System_ID. The File_System_ID is a 32 bit number generated by the device. File System 0 is always present in a device. Each file shall be identified by a File_ID. The File_ID is a 32 bit number generated by the device. File_ID 0 shall be defined by all devices and shall contain information provided by the device that describes the characteristics of the file system. File_ID 0 may not be used as an argument for the CREATE or the DELETE commands. Files may be created with the CREATE command, which returns a non-zero File_ID if successful and a 0 if no file can be created. A file can be deleted with the DELETE command. After a file is deleted, the File_ID may be reused for subsequently created file. The OPEN and CLOSE commands provide hints to the device as to what files will be accessed in the near future. A file may be accessed without being open, but using OPEN and CLOSE will generally improve performance. The LSEEK command provides a hint to the device as to where in a file an access will occur in the near future. A file may be accessed without an LSEEK, but using OPEN and CLOSE might improve performance. The READ, WRITE, and APPEND commands allow the data stored in a file to be read or written. The STATUS command allows for the return of information about a file system or individual file. Add the following commands to the standard (section and opcodes TBD): MOUNT (create, File_System_ID) The File_System_ID is a 32 bit number passed in the CDB. The Create bit is also in the CDB. If Create = 0, then the effect is to make files contained in File_System_ID file system accessible. If Create = 1, then the effect is to create a new file system. In this case the File_System_ID field is ignored and the File_System_ID is returned as DATA. DISMOUNT (destroy, File_System_ID) The File_System_ID is a 32 bit number passed in the CDB. The Destroy bit is also in the CDB. If Destroy = 0, then the effect is to make files contained in File_System_ID file system inaccessible. If Destroy = 1, then the effect is to destroy the file system. CREATE (File_Size, File_Hints) The File_Size is a 32 bit number passed in the CDB. The size is in terms of logical blocks. The File_Hints is a 16 bit field that gives hints to the device on storage allocation and access method. The File_ID is returned as DATA. A File_ID of 0 indicates that the creation was unsuccessful. DELETE (File_ID) The file identified by the File_ID parameter in the CDB is deleted. After deletion, the file can no longer be accessed. OPEN (File_ID, File_Hints) The file identified by the 32 bit number File_ID is opened using the hints defined in the 16 bit File_Hints field. CLOSE (File_ID) The file identified by the 32 bit number File_ID is closed. LSEEK (File_ID,Block_Offset) The device is readied to perform an access at the location specified by the 32 bit Block_Offset field with respect to the beginning of the file specified by the 32 bit number File_ID. READ (File_ID,Block_Offset,Length) The data starting at Block_Offset from the beginning of the file up to the data beginning at Block_Offset+Length blocks is read from the device and transferred to the host. File_ID, Block_Offset, and Length are all 32 bit numbers. WRITE (File_ID,Block_Offset,Length) The data starting at Block_Offset from the beginning of the file up to the data beginning at Block_Offset+Length blocks is transferred from the host and written to the device. File_ID, Block_Offset, and Length are all 32 bit numbers. APPEND (File_ID,Block_Offset,Length) Data is transferred from the host and appended to the end of the file specified by File_ID. File_ID, Block_Offset, and Length are all 32 bit numbers. STATUS (File,ID) If File = 0, then the data returned is that concerning file system specified by ID. If File = 1, then the data returned is that concerning the file specified by ID. File is a bit and ID is a 32 bit number.