This application is a continuation of an claims priority to co-pending U.S. patent application Ser. No. 11/724,232, which is a continuation of co-pending application Ser. No. 11/017,650, filed Dec. 22, 2004, which is a continuation of pending application Ser. No. 10/742,972, filed Dec. 23, 2003, which is a continuation of Ser. No. 09/987,723, filed Nov. 15, 2001, patented as U.S. Pat. No. 6,928,442; which is a which is a continuation of application Ser. No. 09/283,160, filed Apr. 1, 1999, now U.S. Pat. No. 6,415,280, which is a division of application Ser. No. 08/960,079, filed Oct. 24, 1997, now U.S. Pat. No. 5,978,791, which is a continuation of Ser. No. 08/425,160, filed Apr. 11, 1995, now abandoned, the contents of which each of these applications are hereby incorporated herein by reference. This application is a continuation of and claims priority to co-pending application Ser. No. 11/017,650, filed Dec. 22, 2004, which is a continuation of application Ser. No. 09/987,723, filed Nov. 15, 2001, now U.S. Pat. No. 6,928,442, which is a continuation of application Ser. No. 09/283,160, filed Apr. 1, 1999, now U.S. Pat. No. 6,415,280, which is a division of application Ser. No. 08/960,079, filed Oct. 24, 1997, now U.S. Pat. No. 5,978,791, which is a continuation of Ser. No. 08/425,160, filed Apr. 11, 1995, now abandoned, the contents of which each of these applications are hereby incorporated herein by reference. This is also a continuation of and claims priority to co-pending application Ser. No. 10/742,972, filed Dec. 23, 2003, which is a division of application Ser. No. 09/987,723, filed Nov. 15, 2001, now U.S. Pat. No. 6,928,442, which is a continuation of application Ser. No. 09/283,160, filed Apr. 1, 1999, now U.S. Pat. No. 6,415,280, which is a division of application Ser. No. 08/960,079, filed Oct. 24, 1997, now U.S. Pat. No. 5,978,791, which is a continuation of Ser. No. 08/425,160, filed Apr. 11, 1995, now abandoned, the contents of which each of these applications are hereby incorporated herein by reference.
1. Field of the Invention
This invention relates to data processing systems and, more particularly, to data processing systems wherein data items are identified by substantially unique identifiers which depend on all of the data in the data items and only on the data in the data items.
2. Background of the Invention
Data processing (DP) systems, computers, networks of computers, or the like, typically offer users and programs various ways to identify the data in the systems.
Users typically identify data in the data processing system by giving the data some form of name. For example, a typical operating system (OS) on a computer provides a file system in which data items are named by alphanumeric identifiers. Programs typically identify data in the data processing system using a location or address. For example, a program may identify a record in a file or database by using a record number which serves to locate that record.
In all but the most primitive operating systems, users and programs are able to create and use collections of named data items, these collections themselves being named by identifiers. These named collections can then, themselves, be made part of other named collections. For example, an OS may provide mechanisms to group files (data items) into directories (collections). These directories can then, themselves be made part of other directories. A data item may thus be identified relative to these nested directories using a sequence of names, or a so-called pathname, which defines a path through the directories to a particular data item (file or directory).
As another example, a database management system may group data records (data items) into tables and then group these tables into database files (collections). The complete address of any data record can then be specified using the database file name, the table name, and the record number of that data record.
Other examples of identifying data items include: identifying files in a network file system, identifying objects in an object-oriented database, identifying images in an image database, and identifying articles in a text database.
In general, the terms “data” and “data item” as used herein refer to sequences of bits. Thus a data item may be the contents of a file, a portion of a file, a page in memory, an object in an object-oriented program, a digital message, a digital scanned image, a part of a video or audio signal, or any other entity which can be represented by a sequence of bits. The term “data processing” herein refers to the processing of data items, and is sometimes dependent on the type of data item being processed. For example, a data processor for a digital image may differ from a data processor for an audio signal.
In all of the prior data processing systems the names or identifiers provided to identify data items (the data items being files, directories, records in the database, objects in object-oriented programming, locations in memory or on a physical device, or the like) are always defined relative to a specific context. For instance, the file identified by a particular file name can only be determined when the directory containing the file (the context) is known. The file identified by a pathname can be determined only when the file system (context) is known. Similarly, the addresses in a process address space, the keys in a database table, or domain names on a global computer network such as the Internet are meaningful only because they are specified relative to a context.
In prior art systems for identifying data items there is no direct relationship between the data names and the data item. The same data name in two different contexts may refer to different data items, and two different data names in the same context may refer to the same data item.
In addition, because there is no correlation between a data name and the data it refers to, there is no a priori way to confirm that a given data item is in fact the one named by a data name. For instance, in a DP system, if one processor requests that another processor deliver a data item with a given data name, the requesting processor cannot, in general, verify that the data delivered is the correct data (given only the name). Therefore it may require further processing, typically on the part of the requestor, to verify that the data item it has obtained is, in fact, the item it requested.
A common operation in a DP system is adding a new data item to the system. When a new data item is added to the system, a name can be assigned to it only by updating the context in which names are defined. Thus such systems require a centralized mechanism for the management of names. Such a mechanism is required even in a multi-processing system when data items are created and identified at separate processors in distinct locations, and in which there is no other need for communication when data items are added.
In many data processing systems or environments, data items are transferred between different locations in the system. These locations may be processors in the data processing system, storage devices, memory, or the like. For example, one processor may obtain a data item from another processor or from an external storage device, such as a floppy disk, and may incorporate that data item into its system (using the name provided with that data item).
However, when a processor (or some location) obtains a data item from another location in the DP system, it is possible that this obtained data item is already present in the system (either at the location of the processor or at some other location accessible by the processor) and therefore a duplicate of the data item is created. This situation is common in a network data processing environment where proprietary software products are installed from floppy disks onto several processors sharing a common file server. In these systems, it is often the case that the same product will be installed on several systems, so that several copies of each file will reside on the common file server.
In some data processing systems in which several processors are connected in a network, one system is designated as a cache server to maintain master copies of data items, and other systems are designated as cache clients to copy local copies of the master data items into a local cache on an as-needed basis. Before using a cached item, a cache client must either reload the cached item, be informed of changes to the cached item, or confirm that the master item corresponding to the cached item has not changed. In other words, a cache client must synchronize its data items with those on the cache server. This synchronization may involve reloading data items onto the cache client. The need to keep the cache synchronized or reload it adds significant overhead to existing caching mechanisms.
In view of the above and other problems with prior art systems, it is therefore desirable to have a mechanism which allows each processor in a multiprocessor system to determine a common and substantially unique identifier for a data item, using only the data in the data item and not relying on any sort of context.
It is further desirable to have a mechanism for reducing multiple copies of data items in a data processing system and to have a mechanism which enables the identification of identical data items so as to reduce multiple copies. It is further desirable to determine whether two instances of a data item are in fact the same data item, and to perform various other systems' functions and applications on data items without relying on any context information or properties of the data item.
It is also desirable to provide such a mechanism in such a way as to make it transparent to users of the data processing system, and it is desirable that a single mechanism be used to address each of the problems described above.
This invention provides, in a data processing system, a method and apparatus for identifying a data item in the system, where the identity of the data item depends on all of the data in the data item and only on the data in the data item. Thus the identity of a data item is independent of its name, origin, location, address, or other information not derivable directly from the data, and depends only on the data itself.
This invention further provides an apparatus and a method for determining whether a particular data item is present in the system or at a location in the system, by examining only the data identities of a plurality of data items.
Using the method or apparatus of the present invention, the efficiency and integrity of a data processing system can be improved. The present invention improves the design and operation of a data storage system, file system, relational database, object-oriented database, or the like that stores a plurality of data items, by making possible or improving the design and operation of at least some or all of the following features:
the system stores at most one copy of any data item at a given location, even when multiple data names in the system refer to the same contents;
the system avoids copying data from source to destination locations when the destination locations already have the data;
the system provides transparent access to any data item by reference only to its identity and independent of its present location, whether it be local, remote, or offline;
the system caches data items from a server, so that only the most recently accessed data items need be retained;
when the system is being used to cache data items, problems of maintaining cache consistency are avoided;
the system maintains a desired level of redundancy of data items in a network of servers, to protect against failure by ensuring that multiple copies of the data items are present at different locations in the system;
the system automatically archives data items as they are created or modified;
the system provides the size, age, and location of groups of data items in order to decide whether they can be safely removed from a local file system;
the system can efficiently record and preserve any collection of data items;
the system can efficiently make a copy of any collection of data items, to support a version control mechanism for groups of the data items;
the system can publish data items, allowing other, possibly anonymous, systems in a network to gain access to the data items and to rely on the availability of the data items;
the system can maintain a local inventory of all the data items located on a given removable medium, such as a diskette or CD-ROM, the inventory is independent of other properties of the data items such as their name, location, and date of creation;
the system allows closely related sets of data items, such as matching or corresponding directories on disconnected computers, to be periodically resynchronized with one another;
the system can verify that data retrieved from another location is the desired or requested data, using only the data identifier used to retrieve the data;
the system can prove possession of specific data items by content without disclosing the content of the data items, for purposes of later legal verification and to provide anonymity;
the system tracks possession of specific data items according to content by owner, independent of the name, date, or other properties of the data item, and tracks the uses of specific data items and files by content for accounting purposes.
Other objects, features, and characteristics of the present invention as well as the methods of operation and functions of the related elements of structure, and the combination of parts and economies of manufacture, will become more apparent upon consideration of the following description and the appended claims with reference to the accompanying drawings, all of which form a part of this specification.
FIGS. 1 ( a ) and 1 ( b ) depict a typical data processing system in which a preferred embodiment of the present invention operates;
FIG. 2 depicts a hierarchy of data items stored at any location in such a data processing system;
FIGS. 3-9 depict data structures used to implement an embodiment of the present invention; and
FIGS. 10 ( a )- 28 are flow charts depicting operation of various aspects of the present invention.
An embodiment of the present invention is now described with reference to a typical data processing system 100 , which, with reference to FIGS. 1 ( a ) and 1 ( b ), includes one or more processors (or computers) 102 and various storage devices 104 connected in some way, for example by a bus 106 .
Each processor 102 includes a CPU 108 , a memory 110 and one or more local storage devices 112 . The CPU 108 , memory 110 , and local storage device 112 may be internally connected, for example by a bus 114 . Each processor 102 may also include other devices (not shown), such as a keyboard, a display, a printer, and the like.
In a data processing system 100 , wherein more than one processor 102 is used, that is, in a multiprocessor system, the processors may be in one of various relationships. For example, two processors 102 may be in a client/server, client/client, or a server/server relationship. These inter-processor relationships may be dynamic, changing depending on particular situations and functions. Thus, a particular processor 102 may change its relationship to other processors as needed, essentially setting up a peer-to-peer relationship with other processors. In a peer-to-peer relationship, sometimes a particular processor 102 acts as a client processor, whereas at other times the same processor acts as a server processor. In other words, there is no hierarchy imposed on or required of processors 102 .
In a multiprocessor system, the processors 102 may be homogeneous or heterogeneous. Further, in a multiprocessor data processing system 100 , some or all of the processors 102 may be disconnected from the network of processors for periods of time. Such disconnection may be part of the normal operation of the system 100 or it may be because a particular processor 102 is in need of repair.
Within a data processing system 100 , the data may be organized to form a hierarchy of data storage elements, wherein lower level data storage elements are combined to form higher level elements. This hierarchy can consist of, for example, processors, file systems, regions, directories, data files, segments, and the like. For example, with reference to FIG. 2, the data items on a particular processor 102 may be organized or structured as a file system 116 which comprises regions 117 , each of which comprises directories 118 , each of which can contain other directories 118 or files 120 . Each file 120 being made up of one or more data segments 122 .
In a typical data processing system, some or all of these elements can be named by users given certain implementation specific naming conventions, the name (or pathname) of an element being relative to a context. In the context of a data processing system 100 , a pathname is fully specified by a processor name, a file system name, a sequence of zero or more directory names identifying nested directories, and a final file name. (Usually the lowest level elements, in this case segments 122 , cannot be named by users.)
In other words, a file system 116 is a collection of directories 118 . A directory 118 is a collection of named files 120 —both data files 120 and other directory files 118 . A file 120 is a named data item which is either a data file (which may be simple or compound) or a directory file 118 . A simple file 120 consists of a single data segment 122 . A compound file 120 consists of a sequence of data segments 122 . A data segment 122 is a fixed sequence of bytes. An important property of any data segment is its size, the number of bytes in the sequence.
A single processor 102 may access one or more file systems 116 , and a single storage device 104 may contain one or more file systems 116 , or portions of a file system 116 . For instance, a file system 116 may span several storage devices 104 .
In order to implement controls in a file system, file system 116 may be divided into distinct regions, where each region is a unit of management and control. A region consists of a given directory 118 and is identified by the pathname (user defined) of the directory.
In the following, the term “location”, with respect to a data processing system 100 , refers to any of a particular processor 102 in the system, a memory of a particular processor, a storage device, a removable storage medium (such as a floppy disk or compact disk), or any other physical location in the system. The term “local” with respect to a particular processor 102 refers to the memory and storage devices of that particular processor.
In the following, the terms “True Name”, “data identity” and “data identifier” refer to the substantially unique data identifier for a particular data item. The term “True File” refers to the actual file, segment, or data item identified by a True Name.
A file system for a data processing system 100 is now described which is intended to work with an existing operating system by augmenting some of the operating system's file management system codes. The embodiment provided relies on the standard file management primitives for actually storing to and retrieving data items from disk, but uses the mechanisms of the present invention to reference and access those data items.
The processes and mechanisms (services) provided in this embodiment are grouped into the following categories: primitive mechanisms, operating system mechanisms, remote mechanisms, background mechanisms, and extended mechanisms.
Primitive mechanisms provide fundamental capabilities used to support other mechanisms. The following primitive mechanisms are described:
1. Calculate True Name;
2. Assimilate Data Item;
3. True File;
4. Get True Name from Path;
5. Link path to True Name;
6. Realize True File from Location;
7. Locate Remote File;
8. Make True File Local;
9. Create Scratch File;
10. Freeze Directory;
11. Expand Frozen Directory;
12. Delete True File;
13. Process Audit File Entry;
14. Begin Grooming;
15. Select For Removal; and
16. End Grooming.
Operating system mechanisms provide typical familiar file system mechanisms, while maintaining the data structures required to offer the mechanisms of the, present invention. Operating system mechanisms are designed to augment existing operating systems, and in this way to make the present invention compatible with, and generally transparent to, existing applications. The following operating system mechanisms are described:
1. Open File;
2. Close File;
3. Read File;
4. Write File;
5. Delete File or Directory;
6. Copy File or Directory;
7. Move File or Directory;
8. Get File Status; and
9. Get Files in Directory.
Remote mechanisms are used by the operating system in responding to requests from other processors. These mechanisms enable the capabilities of the present invention in a peer-to-peer network mode of operation. The following remote mechanisms are described:
1. Locate True File;
2. Reserve True File;
3. Request True File;
4. Retire True File;
5. Cancel Reservation;
6. Acquire True File;
7. Lock Cache;
8. Update Cache; and
9. Check Expiration Date.
Background mechanisms are intended to run occasionally and at a low priority. These provide automated management capabilities with respect to the present invention. The following background mechanisms are described:
1. Mirror True File;
2. Groom Region;
3. Check for Expired Links; and
4. Verify Region; and
5. Groom Source List.
Extended mechanisms run within application programs over the operating system. These mechanisms provide solutions to specific problems and applications. The following extended mechanisms are described:
1. Inventory Existing Directory;
2. Inventory Removable, Read-only Files;
3. Synchronize directories;
4. Publish Region;
5. Retire Directory;
6. Realize Directory at location;
7. Verify True File;
8. Track for accounting purposes; and
9. Track for licensing purposes.
The file system herein described maintains sufficient information to provide a variety of mechanisms not ordinarily offered by an operating system, some of which are listed and described here. Various processing performed by this embodiment of the present invention will now be described in greater detail.
In some embodiments, some files 120 in a data processing system 100 do not have True Names because they have been recently received or created or modified, and thus their True Names have not yet been computed. A file that does not yet have a True Name is called a scratch file. The process of assigning a True Name to a file is referred to as assimilation, and is described later. Note that a scratch file may have a user provided name.
Some of the processing performed by the present invention can take place in a background mode or on a delayed or as-needed basis. This background processing is used to determine information that is not immediately required by the system or which may never be required. As an example, in some cases a scratch file is being changed at a rate greater than the rate at which it is useful to determine its True Name. In these cases, determining the True Name of the file can be postponed or performed in the background.
Data Structures
The following data structures, stored in memory 110 of one of more processors 102 are used to implement the mechanisms described herein. The data structures can be local to each processor 102 of the system 100 , or they can reside on only some of the processors 102 .
The data structures described are assumed to reside on individual peer processors 102 in the data processing system 100 . However, they can also be shared by placing them on a remote, shared file server (for instance, in a local area network of machines). In order to accommodate sharing data structures, it is necessary that the processors accessing the shared database use the appropriate locking techniques to ensure that changes to the shared database do not interfere with one another but are appropriately serialized. These locking techniques are well understood by ordinarily skilled programmers of distributed applications.
It is sometimes desirable to allow some regions to be local to a particular processor 102 and other regions to be shared among processors 102 . (Recall that a region is a unit of file system management and control consisting of a given directory identified by the pathname of the directory.) In the case of local and shared regions, there would be both local and shared versions of each data structure. Simple changes to the processes described below must be made to ensure that appropriate data structures are selected for a given operation.
The local directory extensions (LDE) table 124 is a data structure which provides information about files 120 and directories 118 in the data processing system 100 . The local directory extensions table 124 is indexed by a pathname or contextual name (that is, a user provided name) of a file and includes the True Name for most files. The information in local directory extension table 124 is in addition to that provided by the native file system of the operating system.
The True File registry (TFR) 126 is a data store for listing actual data items which have True Names, both files 120 and segments 122 . When such data items occur in the True File registry 126 they are known as True Files. True Files are identified in True File registry 126 by their True Names or identities. The table True File registry 126 also stores location, dependency, and migration information about True Files.
The region table (RT) 128 defines areas in the network storage which are to be managed separately. Region table 128 defines the rules for access to and migration of files 120 among various regions with the local file system 116 and remote peer file systems.
The source table (ST) 130 is a list of the sources of True Files other than the current True File registry 126 . The source table 130 includes removable volumes and remote processors.
The audit file (AF) 132 is a list of records indicating changes to be made in local or remote files, these changes to be processed in background.
The accounting log (AL) 134 is a log of file transactions used to create accounting information in a manner which preserves the identity of files being tracked independent of their name or location.
The license table (LT) 136 is a table identifying files, which may only be used by licensed users, in a manner independent of their name or location, and the users licensed to use them.
Detailed Descriptions of the Data Structures
The following table summarizes the fields of an local directory extensions table entry, as illustrated by record 138 in FIG. 3.
| Field | Description |
| Region ID | identifies the region in which this file is contained. |
| Pathname | the user provided name or contextual name of the file or directory, |
| relative to the region in which it occurs. | |
| True Name | the computed True Name or identity of the file or directory. This |
| True Name is not always up to date, and it is set to a special value | |
| when a file is modified and is later recomputed in the background. | |
| Type | indicates whether the file is a data file or a directory. |
| Scratch File | the physical location of the file in the file system, when no True |
| ID | Name has been calculated for the file. As noted above, such a file is |
| called a scratch file. | |
| Time of last | the last access time to this file. If this file is a directory, this is the |
| access | last access time to any file in the directory. |
| Time of last | the time of last change of this file. If this file is a directory, this is |
| modification | the last modification time of any file in the directory. |
| Safe flag | indicates that this file (and, if this file is a directory, all of its |
| subordinate files) have been backed up on some other system, and it | |
| is therefore safe to remove them. | |
| Lock flag | indicates whether a file is locked, that is, it is being modified by the |
| local processor or a remote processor. Only one processor may modify a file | |
| at a time. | |
| Size | the full size of this directory (including all subordinate files), if all |
| files in it were fully expanded and duplicated. For a file that is not a | |
| directory this is the size of the actual True File. | |
| Owner | the identity of the user who owns this file, for accounting and |
| license tracking purposes. | |
Each record of the True File registry 126 has the fields shown in the True File registry record 140 in FIG. 4. The True File registry 126 consists of the database described in the table below as well as the actual True Files identified by the True File IDs below.
| Field | Description |
| True Name | computed True Name or identity of the file. |
| Compressed | compressed version of the True File may be stored instead of, or in |
| File ID | addition to, an uncompressed version. This field provides the |
| identity of the actual representation of the compressed version of the file. | |
| Grooming | tentative count of how many references have been selected for |
| delete count | deletion during a grooming operation. |
| Time of last | most recent date and time the content of this file was accessed. |
| access | |
| Expiration | date and time after which this file may be deleted by this server. |
| Dependent | processor IDs of other processors which contain references to this |
| processors | True File. |
| Source IDs | source ID(s) of zero or more sources from which this file or data |
| item may be retrieved. | |
| True File ID | identity or disk location of the actual physical representation of the |
| file or file segment. It is sufficient to use a filename in the | |
| registration directory of the underlying operating system. The True | |
| File ID is absent if the actual file is not currently present at the | |
| current location. | |
| Use count | number of other records on this processor which identify this True File. |
A region table 128 , specified by a directory pathname, records storage policies which allow files in the file system to be stored, accessed and migrated in different ways. Storage policies are programmed in a configurable way using a set of rules described below.
Each region table record 142 of region table 128 includes the fields described in the following table (with reference to FIG. 5):
| Field | Description |
| Region ID | internally used identifier for this region. |
| Region file | file system on the local processor of which this region is a part. |
| system | |
| Region | a pathname relative to the region file system which defines the |
| pathname | location of this region. The region consists of all files and |
| directories subordinate to this pathname, except those in a region | |
| subordinate to this region. | |
| Mirror | zero or more identifiers of processors which are to keep mirror or |
| processor(s) | archival copies of all files in the current region. Multiple mirror |
| processors can be defined to form a mirror group. | |
| Mirror | number of copies of each file in this region that should be retained |
| duplication count | in a mirror group. |
| Region | specifies whether this region is local to a single processor 102, |
| status | shared by several processors 102 (if, for instance, it resides on a |
| shared file server), or managed by a remote processor. | |
| Policy | the migration policy to apply to this region. A single region might |
| participate in several policies. The policies are as follows | |
| (parameters in brackets are specified as part of the policy): | |
| region is a cached version from [processor ID]; | |
| region is a member of a mirror set defined by [processor ID]. | |
| region is to be archived on [processor ID]. | |
| region is to be backed up locally, by placing new copies in [region ID]. | |
| region is read only and may not be changed. | |
| region is published and expires on [date]. | |
| Files in this region should be compressed. | |
A source table 130 identifies a source location for True Files. The source table 130 is also used to identify client processors making reservations on the current processor. Each source record 144 of the source table 130 includes the fields summarized in the following table, with reference to FIG. 6:
| Field | Description |
| source ID | internal identifier used to identify a particular source. |
| source type | type of source location: |
| Removable Storage Volume | |
| Local Region | |
| Cache Server | |
| Mirror Group Server | |
| Cooperative Server | |
| Publishing Server | |
| Client | |
| source rights | includes information about the rights of this processor, such as |
| whether it can ask the local processor to store data items for it. | |
| source availability | measurement of the bandwidth, cost, and reliability of the |
| connection to this source of True Files. The availability is used to | |
| select from among several possible sources. | |
| source | information on how the local processor is to access the source. This |
| location | may be, for example, the name of a removable storage volume, or |
| the processor ID and region path of a region on a remote processor. | |
The audit file 132 is a table of events ordered by timestamp, each record 146 in audit file 132 including the fields summarized in the following table (with reference to FIG. 7):
| Field | Description |
| Original | path of the file in question. |
| Name | |
| Operation | whether the file was created, read, written, copied or |
| deleted. | |
| Type | specifies whether the source is a file or a directory. |
| Processor | ID of the remote processor generating this event |
| ID | (if not local). |
| Timestamp | time and date file was closed (required only for accessed/ |
| modified files). | |
| Pathname | Name of the file (required only for rename). |
| True Name | computed True Name of the file. This is used by remote |
| systems to mirror changes to the directory and is filled | |
| in during background processing. | |
Each record 148 of the accounting log 134 records an event which may later be used to provide information for billing mechanisms. Each accounting log entry record 148 includes at least the information summarized in the following table, with reference to FIG. 8:
| Field | Description |
| date of entry | date and time of this log entry. |
| type of entry | Entry types include create file, delete file, and transmit file. |
| True Name | True Name of data item in question. |
| owner | identity of the user responsible for this action. |
Each record 150 of the license table 136 records a relationship between a licensable data item and the user licensed to have access to it. Each license table record 150 includes the information summarized in the following table, with reference to FIG. 9:
| Field | Description |
| True Name | True Name of a data item subject to license validation. |
| licensee | identity of a user authorized to have access to this object. |
Various other data structures are employed on some or all of the processors 102 in the data processing system 100 . Each processor 102 has a global freeze lock (GFL) 152 (FIG. 1), which is used to prevent synchronization errors when a directory is frozen or copied. Any processor 102 may include a special archive directory (SAD) 154 into which directories may be copied for the purposes of archival. Any processor 102 may include a special media directory (SMD) 156 , into which the directories of removable volumes are stored to form a media inventory. Each processor has a grooming lock 158 , which is set during a grooming operation. During this period the grooming delete count of True File registry entries 140 is active, and no True Files should be deleted until grooming is complete. While grooming is in effect, grooming information includes a table of pathnames selected for deletion, and keeps track of the amount of space that would be freed if all of the files were deleted.
Primitive Mechanisms
The first of the mechanisms provided by the present invention, primitive mechanisms, are now described. The mechanisms described here depend on underlying data management mechanisms to create, copy, read, and delete data items in the True File registry 126 , as identified by a True File ID. This support may be provided by an underlying operating system or disk storage manager.
The following primitive mechanisms are described:
1. Calculate True Name;
2. Assimilate Data Item;
3. True File;
4. Get True Name from Path;
5. Link Path to True Name;
6. Realize True File from Location;
7. Locate Remote File;
8. Make True File Local;
9. Create Scratch File;
10. Freeze Directory;
11. Expand Frozen Directory;
12. Delete True File;
13. Process Audit File Entry;
14. Begin Grooming;
15. Select For Removal; and
16. End Grooming.
1. Calculate True Name
A True Name is computed using a function, MD, which reduces a data block B of arbitrary length to a relatively small, fixed size identifier, the True Name of the data block, such that the True Name of the data block is virtually guaranteed to represent the data block B and only data block B.
The function MD must have the following properties:
A family of functions with the above properties are the so-called message digest functions, which are used in digital security systems as techniques for authentification of data. These functions (or algorithms) include MD4, MD5, and SHA.
In the presently preferred embodiments, either MD5 or SHA is employed as the basis for the computation of True Names. Whichever of these two message digest functions is employed, that same function must be employed on a system-wide basis.
It is impossible to define a function having a unique output for each possible input when the number of elements in the range of the function is smaller than the number of elements in its domain. However, a crucial observation is that the actual data items that will be encountered in the operation of any system embodying this invention form a very sparse subset of all the possible inputs.
A colliding set of data items is defined as a set wherein, for one or more pairs x and y in the set, MD(x)=MD(y). Since a function conforming to the requirements for MD must evenly and randomly distribute its outputs, it is possible, by making the range of the function large enough, to make the probability arbitrarily small that actual inputs encountered in the operation of an embodiment of this invention will form a colliding set.
To roughly quantify the probability of a collision, assume that there are no more than 2 30 storage devices in the world, and that each storage device has an average of at most 2 20 different data items. Then there are at most 2 50 data items in the world. If the outputs of MD range between 0 and 2 128 , it can be demonstrated that the probability of a collision is approximately 1 in 2 29 . Details on the derivation of these probability values are found, for example, in P. Flajolet and A. M. Odlyzko, “Random Mapping Statistics,” Lecture Notes in Computer Science 434: Advances in Cryptology—Eurocrypt ' 89 Proceedings , Springer-Verlag, pp. 329-354.
Note that for some less preferred embodiments of the present invention, lower probabilities of uniqueness may be acceptable, depending on the types of applications and mechanisms used. In some embodiments it may also be useful to have more than one level of True Names, with some of the True Names having different degrees of uniqueness. If such a scheme is implemented, it is necessary to ensure that less unique True Names are not propagated in the system.
While the invention is described herein using only the True Name of a data item as the identifier for the data item, other preferred embodiments use tagged, typed, categorized or classified data items and use a combination of both the True Name and the tag, type, category or class of the data item as an identifier. Examples of such categorizations are files, directories, and segments; executable files and data files, and the like. Examples of classes are classes of objects in an object-oriented system. In such a system, a lower degree of True Name uniqueness is acceptable over the entire universe of data items, as long as sufficient uniqueness. is provided per category of data items. This is because the tags provide an additional level of uniqueness.
A mechanism for calculating a True Name given a data item is now described, with reference to FIGS. 10 ( a ) and 10 ( b ).
A simple data item is a data item whose size is less than a particular given size (which must be defined in each particular implementation of the invention). To determine the True Name of a simple data item, with reference to FIG. 10( a ), first compute the MD function (described above) on the given simple data item (Step S 212 ). Then append to the resulting 128 bits, the byte length modulo 32 of the data item (Step S 214 ). The resulting 160-bit value is the True Name of the simple data item.
A compound data item is one whose size is greater than the particular given size of a simple data item. To determine the True Name of an arbitrary (simple or compound) data item, with reference to FIG. 10( b ), first determine if the data item is a simple or a compound data item (Step S 216 ). If the data item is a simple data item, then compute its True Name in step S 218 (using steps S 212 and S 214 described above), otherwise partition the data item into segments (Step S 220 ) and assimilate each segment (Step S 222 ) (the primitive mechanism, Assimilate a Data Item, is described below), computing the True Name of the segment. Then create an indirect block consisting of the computed segment True Names (Step S 224 ). An indirect block is a data item which consists of the sequence of True Names of the segments. Then, in step S 226 , assimilate the indirect block and compute its True Name. Finally, replace the final thirty-two (32) bits of the resulting True Name (that is, the length of the indirect block) by the length modulo 32 of the compound data item (Step S 228 ). The result is the True Name of the compound data item.
Note that the compound data item may be so large that the indirect block of segment True Names is itself a compound data item. In this case the mechanism is invoked recursively until only simple data items are being processed.
Both the use of segments and the attachment of a length to the True Name are not strictly required in a system using the present invention, but are currently considered desirable features in the preferred embodiment.
2. Assimilate Data Item
A mechanism for assimilating a data item (scratch file or segment) into a file system, given the scratch file ID of the data item, is now described with reference to FIG. 11. The purpose of this mechanism is to add a given data item to the True File registry 126 . If the data item already exists in the True File registry 126 , this will be discovered and used during this process, and the duplicate will be eliminated.
Thereby the system stores at most one copy of any data item or file by content, even when multiple names refer to the same content.
First, determine the True Name of the data item corresponding to the given scratch File ID using the Calculate True Name primitive mechanism (Step S 230 ). Next, look for an entry for the True Name in the True File registry 126 (Step S 232 ) and determine whether a True Name entry, record 140 , exists in the True File registry 126 . If the entry record includes a corresponding True File ID or compressed File ID (Step S 237 ), delete the file with the scratch File ID (Step S 238 ). Otherwise store the given True File ID in the entry record (step S 239 ).
If it is determined (in step S 232 ) that no True Name entry exists in the True File registry 126 , then, in Step S 236 , create a new entry in the True File registry 126 for this True Name. Set the True Name of the entry to the calculated True Name, set the use count for the new entry to one, store the given True File ID in the entry and set the other fields of the entry as appropriate.
Because this procedure may take some time to compute, it is intended to run in background after a file has ceased to change. In the meantime, the file is considered an unassimilated scratch file.
3. True File
The True File process is invoked when processing the audit file 132 , some time after a True File has been assimilated (using the Assimilate Data Item primitive mechanism). Given a local directory extensions table entry record 138 in the local directory extensions table 124 , the True File process can provide the following steps (with reference to FIG. 12), depending on how the local processor is configured:
First, in step S 238 , examine the local directory extensions table entry record 138 to determine whether the file is locked by a cache server. If the file is locked, then add the ID of the cache server to the dependent processor list of the True File registry table 126 , and then send a message to the cache server to update the cache of the current processor using the Update Cache remote mechanism (Step 242 ).
If desired, compress the True File (Step S 246 ), and, if desired, mirror the True File using the Mirror True File background mechanism (Step S 248 ).
4. Get True Name from Path
The True Name of a file can be used to identify a file by contents, to confirm that a file matches its original contents, or to compare two files. The mechanism to get a True Name given the pathname of a file is now described with reference to FIG. 13.
First, search the local directory extensions table 124 for the entry record 138 with the given pathname (Step S 250 ). If the pathname is not found, this process fails and no True Name corresponding to the given pathname exists. Next, determine whether the local directory extensions table entry record 138 includes a True Name (Step S 252 ), and if so, the mechanism's task is complete. Otherwise, determine whether the local directory extensions table entry record 138 identifies a directory (Step S 254 ), and if so, freeze the directory (Step S 256 ) (the primitive mechanism Freeze Directory is described below).
Otherwise, in step S 258 , assimilate the file (using the Assimilate Data Item primitive mechanism) defined by the File ID field to generate its True Name and store its True Name in the local directory extensions entry record. Then return the True Name identified by the local directory extensions table 124 .
5. Link Path to True Name
The mechanism to link a path to a True Name provides a way of creating a new directory entry record identifying an existing, assimilated file. This basic process may be used to copy, move, and rename files without a need to copy their contents. The mechanism to link a path to a True Name is now described with reference to FIG. 14.
First, if desired, confirm that the True Name exists locally by searching for it in the True Name registry or local directory extensions table 135 (Step S 260 ). Most uses of this mechanism will require this form of validation. Next, search for the path in the local directory extensions table 135 (Step S 262 ). Confirm that the directory containing the file named in the path already exists (Step S 264 ). If the named file itself exists, delete the File using the Delete True File operating system mechanism (see below) (Step S 268 ).
Then, create an entry record in the local directory extensions with the specified path (Step S 270 ) and update the entry record and other data structures as follows: fill in the True Name field of the entry with the specified True Name; increment the use count for the True File registry entry record 140 of the corresponding True Name; note whether the entry is a directory by reading the True File to see if it contains a tag (magic number) indicating that it represents a frozen directory (see also the description of the Freeze Directory primitive mechanism regarding the tag); and compute and set the other fields of the local directory extensions appropriately. For instance, search the region table 128 to identify the region of the path, and set the time of last access and time of last modification to the current time.
6. Realize True File from Location
This mechanism is used to try to make a local copy of a True File, given its True Name and the name of a source location (processor or media) that may contain the True File. This mechanism is now described with reference to FIG. 15.
First, in step S 272 , determine whether the location specified is a processor. If it is determined that the location specified is a processor, then send a Request True File message (using the Request True File remote mechanism) to the remote processor and wait for a response (Step S 274 ). If a negative response is received or no response is received after a timeout period, this mechanism fails. If a positive response is received, enter the True File returned in the True File registry 126 (Step S 276 ). (If the file received was compressed, enter the True File ID in the compressed File ID field.)
If, on the other hand, it is determined in step S 272 that the location specified is not a processor, then, if necessary, request the user or operator to mount the indicated volume (Step S 278 ). Then (Step S 280 ) find the indicated file on the given volume and assimilate the file using the Assimilate Data Item primitive mechanism. If the volume does not contain a True File registry 126 , search the media inventory to find the path of the file on the volume. If no such file can be found, this mechanism fails.
At this point, whether or not the location is determined (in step S 272 ) to be a processor, if desired, verify the True File (in step S 282 ).
7. Locate Remote File
This mechanism allows a processor to locate a file or data item from a remote source of True Files, when a specific source is unknown or unavailable. A client processor system may ask one of several or many sources whether it can supply a data object with a given True Name. The steps to perform this mechanism are as follows (with reference to FIGS. 16 ( a ) and 16 ( b )).
The client processor 102 uses the source table 145 to select one or more source processors (Step S 284 ). If no source processor can be found, the mechanism fails. Next, the client processor 102 broadcasts to the selected sources a request to locate the file with the given True Name using the Locate True File remote mechanism (Step S 286 ). The request to locate may be augmented by asking to propagate this request to distant servers. The client processor then waits for one or more servers to respond positively (Step S 288 ). After all servers respond negatively, or after a timeout period with no positive response, the mechanism repeats selection (Step S 284 ) to attempt to identify alternative sources. If any selected source processor responds, its processor ID is the result of this mechanism. Store the processor ID in the source field of the True File registry entry record 140 of the given True Name (Step S 290 ).
If the source location of the True Name is a different processor or medium than the destination (Step S 290 a ), perform the following steps:
Source selection in step S 284 may be based on optimizations involving general availability of the source, access time, bandwidth, and transmission cost, and ignoring previously selected processors which did not respond in step S 288 .
8. Make True File Local
This mechanism is used when a True Name is known and a locally accessible copy of the corresponding file or data item is required. This mechanism makes it possible to actually read the data in a True File. The mechanism takes a True Name and returns when there is a local, accessible copy of the True File in the True File registry 126 . This mechanism is described here with reference to the flow chart of FIGS. 17 ( a ) and 17 ( b ).
First, look in the True File registry 126 for a True File entry record 140 for the corresponding True Name (Step S 292 ). If no such entry is found this mechanism fails. If there is already a True File ID for the entry (Step S 294 ), this mechanism's task is complete. If there is a compressed file ID for the entry (Step S 296 ), decompress the file corresponding to the file ID (Step S 298 ) and store the decompressed file ID in the entry (Step S 300 ). This mechanism is then complete.
If there is no True File ID for the entry (Step S 294 ) and there is no compressed file ID for the entry (Step S 296 ), then continue searching for the requested file. At this time it may be necessary to notify the user that the system is searching for the requested file.
If there are one or more source IDs, then select an order in which to attempt to realize the source ID (Step S 304 ). The order may be based on optimizations involving general availability of the source, access time, bandwidth, and transmission cost. For each source in the order chosen, realize the True File from the source location (using the Realize True File from Location primitive mechanism), until the True File is realized (Step S 306 ). If it is realized, continue with step S 294 . If no known source can realize the True File, use the Locate Remote File primitive mechanism to attempt to find the True File (Step S 308 ). If this succeeds, realize the True File from the identified source location and continue with step S 296 .
9. Create Scratch File
A scratch copy of a file is required when a file is being created or is about to be modified. The scratch copy is stored in the file system of the underlying operating system. The scratch copy is eventually assimilated when the audit file record entry 146 is processed by the Process Audit File Entry primitive mechanism. This Create Scratch File mechanism requires a local directory extensions table entry record 138 . When it succeeds, the local directory extensions table entry record 138 contains the scratch file ID of a scratch file that is not contained in the True File registry 126 and that may be modified. This mechanism is now described with reference to FIGS. 18 ( a ) and 18 ( b ).
First determine whether the scratch file should be a copy of the existing True File (Step S 310 ). If so, continue with step S 312 . Otherwise, determine whether the local directory extensions table entry record 138 identifies an existing True File (Step S 316 ), and if so, delete the True File using the Delete True File primitive mechanism (Step S 318 ). Then create a new, empty scratch file and store its scratch file ID in the local directory extensions table entry record 138 (step S 320 ). This mechanism is then complete.
If the local directory extensions table entry record 138 identifies a scratch file ID (Step S 312 ), then the entry already has a scratch file, so this mechanism succeeds.
If the local directory extensions table entry record 138 identifies a True File (S 316 ), and there is no True File ID for the True File (S 312 ), then make the True File local using the Make True File Local primitive mechanism (Step S 322 ). If there is still no True File ID, this mechanism fails.
There is now a local True File for this file. If the use count in the corresponding True File registry entry record 140 is one (Step S 326 ), save the True File ID in the scratch file ID of the local directory extensions table entry record 138 , and remove the True File registry entry record 140 (Step S 328 ). (This step makes the True File into a scratch file.) This mechanism's task is complete.
Otherwise, if the use count in the corresponding True File registry entry record 140 is not one (in step S 326 ), copy the file with the given True File ID to a new scratch file, using the Read File OS mechanism and store its file ID in the local directory extensions table entry record 138 (Step S 330 ), and reduce the use count for the True File by one. If there is insufficient space to make a copy, this mechanism fails.
10. Freeze Directory
This mechanism freezes a directory in order to calculate its True Name. Since the True Name of a directory is a function of the files within the directory, they must not change during the computation of the True Name of the directory. This mechanism requires the pathname of a directory to freeze. This mechanism is described with reference to FIGS. 19 ( a ) and 19 ( b ).
In step S 332 , add one to the global freeze lock. Then search the local directory extensions table 124 to find each subordinate data file and directory of the given directory, and freeze each subordinate directory found using the Freeze Directory primitive mechanism (Step S 334 ). Assimilate each unassimilated data file in the directory using the Assimilate Data Item primitive mechanism (Step S 336 ). Then create a data item which begins with a tag or marker (a “magic number”) being a unique data item indicating that this data item is a frozen directory (Step S 337 ). Then list the file name and True Name for each file in the current directory (Step S 338 ). Record any additional information required, such as the type, time of last access and modification, and size (Step S 340 ). Next, in step S 342 , using the Assimilate Data Item primitive mechanism, assimilate the data item created in step S 338 . The resulting True Name is the True Name of the frozen directory. Finally, subtract one from the global freeze lock (Step S 344 ).
11. Expand Frozen Directory
This mechanism expands a frozen directory in a given location. It requires a given pathname into which to expand the directory, and the True Name of the directory and is described with reference to FIG. 20.
First, in step S 346 , make the True File with the given True Name local using the Make True File Local primitive mechanism. Then read each directory entry in the local file created in step S 346 (Step S 348 ). For each such directory entry, do the following:
Create a full pathname using the given pathname and the file name of the entry (Step S 350 ); and
link the created path to the True Name (Step S 352 ) using the Link Path to True Name primitive mechanism.
12. Delete True File
This mechanism deletes a reference to a True Name. The underlying True File is not removed from the True File registry 126 unless there are no additional references to the file. With reference to FIG. 21, this mechanism is performed as follows:
If the global freeze lock is on, wait until the global freeze lock is turned off (Step S 354 ). This prevents deleting a True File while a directory which might refer to it is being frozen. Next, find the True File registry entry record 140 given the True Name (Step S 356 ). If the reference count field of the True File registry 126 is greater than zero, subtract one from the reference count field (Step S 358 ). If it is determined (in step S 360 ) that the reference count field of the True File registry entry record 140 is zero, and if there are no dependent systems listed in the True File registry entry record 140 , then perform the following steps:
(i) If the True File is a simple data item, then delete the True File, otherwise,
(ii) (the True File is a compound data item) for each True Name in the data item, recursively delete the True File corresponding to the True Name (Step S 362 ).
(iii) Remove the file indicated by the True File ID and compressed file ID from the True File registry 126 , and remove the True File registry entry record 140 (Step S 364 ).
13. Process Audit File Entry
This mechanism performs tasks which are required to maintain information in the local directory extensions table 124 and True File registry 126 , but which can be delayed while the processor is busy doing more time-critical tasks. Entries 142 in the audit file 132 should be processed at a background priority as long as there are entries to be processed. With reference to FIG. 22, the steps for processing an entry are as follows:
Determine the operation in the entry 142 currently being processed (Step S 365 ). If the operation indicates that a file was created or written (Step S 366 ), then assimilate the file using the Assimilate Data Item primitive mechanism (Step S 368 ), use the True File primitive mechanism to do additional desired processing (such as cache update, compression, and mirroring) (Step S 369 ), and record the newly computed True Name for the file in the audit file record entry (Step S 370 ).
Otherwise, if the entry being processed indicates that a compound data item or directory was copied (or deleted) (Step S 376 ), then for each component True Name in the compound data item or directory, add (or subtract) one to the use count of the True File registry entry record 140 corresponding to the component True Name (Step S 378 ).
In all cases, for each parent directory of the given file, update the size, time of last access, and time of last modification, according to the operation in the audit record (Step S 379 ).
Note that the audit record is not removed after processing, but is retained for some reasonable period so that it may be used by the Synchronize Directory extended mechanism to allow a disconnected remote processor to update its representation of the local system.
14. Begin Grooming
This mechanism makes it possible to select a set of files for removal and determine the overall amount of space to be recovered. With reference to FIG. 23, first verify that the global grooming lock is currently unlocked (Step S 382 ). Then set the global grooming lock, set the total amount of space freed during grooming to zero and empty the list of files selected for deletion (Step S 384 ). For each True File in the True File registry 126 , set the delete count to zero (Step S 386 ).
15. Select For Removal
This grooming mechanism tentatively selects a pathname to allow its corresponding True File to be removed. With reference to FIG. 24, first find the local directory extensions table entry record 138 corresponding to the given pathname (Step S 388 ). Then find the True File registry entry record 140 corresponding to the True File name in the local directory extensions table entry record 138 (Step S 390 ). Add one to the grooming delete count in the True File registry entry record 140 and add the pathname to a list of files selected for deletion (Step S 392 ). If the grooming delete count of the True File registry entry record 140 is equal to the use count of the True File registry entry record 140 , and if the there are no entries in the dependency list of the True File registry entry record 140 , then add the size of the file indicated by the True File ID and or compressed file ID to the total amount of space freed during grooming (Step S 394 ).
16. End Grooming
This grooming mechanism ends the grooming phase and removes all files selected for removal. With reference to FIG. 25, for each file in the list of files selected for deletion, delete the file (Step S 396 ) and then unlock the global grooming lock (Step S 398 ).
Operating System Mechanisms
The next of the mechanisms provided by the present invention, operating system mechanisms, are now described.
The following operating system mechanisms are described:
1. Open File;
2. Close File;
3. Read File;
4. Write File;
5. Delete File or Directory;
6. Copy File or Directory;
7. Move File or Directory;
8. Get File Status; and
9. Get Files in Directory.
1. Open File
A mechanism to open a file is described with reference to FIGS. 26 ( a ) and 26 ( b ). This mechanism is given as input a pathname and the type of access required for the file (for example, read, write, read/write, create, etc.) and produces either the File ID of the file to be opened or an indication that no file should be opened. The local directory extensions table record 138 and region table record 142 associated with the opened file are associated with the open file for later use in other processing functions which refer to the file, such as read, write, and close.
First, determine whether or not the named file exists locally by examining the local directory extensions table 124 to determine whether there is an entry corresponding to the given pathname (Step S 400 ). If it is determined that the file name does not exist locally, then, using the access type, determine whether or not the file is being created by this opening process (Step S 402 ). If the file is not being created, prohibit the open (Step S 404 ). If the file is being created, create a zero-length scratch file using an entry in local directory extensions table 124 and produce the scratch file ID of this scratch file as the result (Step S 406 ).
If, on the other hand, it is determined in step S 400 that the file name does exist locally, then determine the region in which the file is located by searching the region table 128 to find the record 142 with the longest region path which is a prefix of the file pathname (Step S 408 ). This record identifies the region of the specified file.
Next, determine using the access type, whether the file is being opened for writing or whether it is being opened only for reading (Step S 410 ). If the file is being opened for reading only, then, if the file is a scratch file (Step S 419 ), return the scratch File ID of the file (Step S 424 ). Otherwise get the True Name from the local directory extensions table 124 and make a local version of the True File associated with the True Name using the Make True File Local primitive mechanism, and then return the True File ID associated with the True Name (Step S 420 ).
If the file is not being opened for reading only (Step S 410 ), then, if it is determined by inspecting the region table entry record 142 that the file is in a read-only directory (Step S 416 ), then prohibit the opening (Step S 422 ).
If it is determined by inspecting the region table 128 that the file is in a cached region (Step S 423 ), then send a Lock Cache message to the corresponding cache server, and wait for a return message (Step S 418 ). If the return message says the file is already locked, prohibit the opening.
If the access type indicates that the file being modified is being rewritten completely (Step S 419 ), so that the original data will not be required, then Delete the File using the Delete File OS mechanism (Step S 421 ) and perform step S 406 . Otherwise, make a scratch copy of the file (Step S 417 ) and produce the scratch file ID of the scratch file as the result (Step S 424 ).
2. Close File
This mechanism takes as input the local directory extensions table entry record 138 of an open file and the data maintained for the open file. To close a file, add an entry to the audit file indicating the time and operation (create, read or write). The audit file processing (using the Process Audit File Entry primitive mechanism) will take care of assimilating the file and thereby updating the other records.
3. Read File
To read a file, a program must provide the offset and length of the data to be read, and the location of a buffer into which to copy the data read.
The file to be read from is identified by an open file descriptor which includes a File ID as computed by the Open File operating system mechanism defined above. The File ID may identify either a scratch file or a True File (or True File segment). If the File ID identifies a True File, it may be either a simple or a compound True File. Reading a file is accomplished by the following steps:
In the case where the File ID identifies a scratch file or a simple True File, use the read capabilities of the underlying operating system.
In the case where the File ID identifies a compound file, break the read operation into one or more read operations on component segments as follows:
A. Identify the segment(s) to be read by dividing the specified file offset and length each by the fixed size of a segment (a system dependent parameter), to determine the segment number and number of segments that must be read.
B. For each segment number computed above, do the following:
File writing uses the file ID and data management capabilities of the underlying operating system. File access (Make File Local described above) can be deferred until the first read or write.
5. Delete File or Directory
The process of deleting a file, for a given pathname, is described here with reference to FIGS. 27 ( a ) and 27 ( b ).
First, determine the local directory extensions table entry record 138 and region table entry record 142 for the file (Step S 422 ). If the file has no local directory extensions table entry record 138 or is locked or is in a read-only region, prohibit the deletion.
Identify the corresponding True File given the True Name of the file being deleted using the True File registry 126 (Step S 424 ). If the file has no True Name, (Step S 426 ) then delete the scratch copy of the file based on its scratch file ID in the local directory extensions table 124 (Step S 427 ), and continue with step S 428 .
If the file has a True Name and the True File's use count is one (Step S 429 ), then delete the True File (Step S 430 ), and continue with step S 428 .
If the file has a True Name and the True File's use count is greater than one, reduce its use count by one (Step S 431 ). Then proceed with step S 428 .
In Step S 428 , delete the local directory extensions table entry record, and add an entry to the audit file 132 indicating the time and the operation performed (delete).
6. Copy File or Directory
A mechanism is provided to copy a file or directory given a source and destination processor and pathname. The Copy File mechanism does not actually copy the data in the file, only the True Name of the file. This mechanism is performed as follows:
(A) Given the source path, get the True Name from the path. If this step fails, the mechanism fails.
(B) Given the True Name and the destination path, link the destination path to the True Name.
(C) If the source and destination processors have different True File registries, find (or, if necessary, create) an entry for the True Name in the True File registry table 126 of the destination processor. Enter into the source ID field of this new entry the source processor identity.
(D) Add an entry to the audit file 132 indicating the time and operation performed (copy).
This mechanism addresses capability of the system to avoid copying data from a source location to a destination location when the destination already has the data. In addition, because of the ability to freeze a directory, this mechanism also addresses capability of the system immediately to make a copy of any collection of files, thereby to support an efficient version control mechanisms for groups of files.
7. Move File or Directory
A mechanism is described which moves (or renames) a file from a source path to a destination path. The move operation, like the copy operation, requires no actual transfer of data, and is performed as follows:
(A) Copy the file from the source path to the destination path.
(B) If the source path is different from the destination path, delete the source path.
8. Get File Status
This mechanism takes a file pathname and provides information about the pathname. First the local directory extensions table entry record 138 corresponding to the pathname given is found. If no such entry exists, then this mechanism fails, otherwise, gather information about the file and its corresponding True File from the local directory extensions table 124 . The information can include any information shown in the data structures, including the size, type, owner, True Name, sources, time of last access, time of last modification, state (local or not, assimilated or not, compressed or not), use count, expiration date, and reservations.
9. Get Files in Directory
This mechanism enumerates the files in a directory. It is used (implicitly) whenever it is necessary to determine whether a file exists (is present) in a directory. For instance, it is implicitly used in the Open File, Delete File, Copy File or Directory, and Move File operating system mechanisms, because the files operated on are referred to by pathnames containing directory names. The mechanism works as follows:
The local directory extensions table 124 is searched for an entry 138 with the given directory pathname. If no such entry is found, or if the entry found is not a directory, then this mechanism fails.
If there is a corresponding True File field in the local directory extensions table record, then it is assumed that the True File represents a frozen directory. The Expand Frozen Directory primitive mechanism is used to expand the existing True File into directory entries in the local directory extensions table.
Finally, the local directory extensions table 124 is again searched, this time to find each directory subordinate to the given directory. The names found are provided as the result.
Remote Mechanisms
The remote mechanisms provided by the present invention are now described. Recall that remote mechanisms are used by the operating system in responding to requests from other processors. These mechanisms enable the capabilities of the present invention in a peer-to-peer network mode of operation.
In a presently preferred embodiment, processors communicate with each other using a remote procedure call (RPC) style interface, running over one of any number of communication protocols such as IPX/SPX or TCP/IP. Each peer processor which provides access to its True File registry 126 or file regions, or which depends on another peer processor, provides a number of mechanisms which can be used by its peers.
The following remote mechanisms are described:
1. Locate True File;
2. Reserve True File;
3. Request True File;
4. Retire True File;
5. Cancel Reservation;
6. Acquire True File;
7. Lock Cache;
8. Update Cache; and
9. Check Expiration Date.
1. Locate True File
This mechanism allows a remote processor to determine whether the local processor contains a copy of a specific True File. The mechanism begins with a True Name and a flag indicating whether to forward requests for this file to other servers. This mechanism is now described with reference to FIG. 28.
First determine if the True File is available locally or if there is some indication of where the True File is located (for example, in the Source IDs field). Look up the requested True Name in the True File registry 126 (Step S 432 ).
If a True File registry entry record 140 is not found for this True Name (Step S 434 ), and the flag indicates that the request is not to be forwarded (Step S 436 ), respond negatively (Step S 438 ). That is, respond to the effect that the True File is not available.
One the other hand, if a True File registry entry record 140 is not found (Step S 434 ), and the flag indicates that the request for this True File is to be forwarded (Step S 436 ), then forward a request for this True File to some other processors in the system (Step S 442 ). If the source table for the current processor identifies one or more publishing servers which should have a copy of this True File, then forward the request to each of those publishing servers (Step S 436 ).
If a True File registry entry record 140 is found for the required True File (Step S 434 ), and if the entry includes a True File ID or Compressed File ID (Step S 440 ), respond positively (Step S 444 ). If the entry includes a True File ID then this provides the identity or disk location of the actual physical representation of the file or file segment required. If the entry include a Compressed File ID, then a compressed version of the True File may be stored instead of, or in addition to, an uncompressed version. This field provides the identity of the actual representation of the compressed version of the file.
If the True File registry entry record 140 is found (Step S 434 ) but does not include a True File ID (the File ID is absent if the actual file is not currently present at the current location) (Step S 440 ), and if the True File registry entry record 140 includes one or more source processors, and if the request can be forwarded, then forward the request for this True File to one or more of the source processors (Step S 444 ).
2. Reserve True File
This mechanism allows a remote processor to indicate that it depends on the local processor for access to a specific True File. It takes a True Name as input. This mechanism is described here.
(A) Find the True File registry entry record 140 associated with the given True File. If no entry exists, reply negatively.
(B) If the True File registry entry record 140 does not include a True File ID or compressed File ID, and if the True File registry entry record 140 includes no source IDs for removable storage volumes, then this processor does not have access to a copy of the given file. Reply negatively.
(C) Add the ID of the sending processor to the list of dependent processors for the True File registry entry record 140 . Reply positively, with an indication of whether the reserved True File is on line or off line.
3. Request True File
This mechanism allows a remote processor to request a copy of a True File from the local processor. It requires a True Name and responds positively by sending a True File back to the requesting processor. The mechanism operates as follows:
(A) Find the True File registry entry record 140 associated with the given True Name. If there is no such True File registry entry record 140 , reply negatively.
(B) Make the True File local using the Make True File Local primitive mechanism. If this mechanism fails, the Request True File mechanism also fails.
(C) Send the local True File in either it is uncompressed or compressed form to the requesting remote processor. Note that if the True File is a compound file, the components are not sent.
(D) If the remote file is listed in the dependent process list of the True File registry entry record 140 , remove it.
4. Retire True File
This mechanism allows a remote processor to indicate that it no longer plans to maintain a copy of a given True File. An alternate source of the True File can be specified, if, for instance, the True File is being moved from one server to another. It begins with a True Name, a requesting processor ID, and an optional alternate source. This mechanism operates as follows:
(A) Find a True Name entry in the True File registry 126 . If there is no entry for this True Name, this mechanism's task is complete.
(B) Find the requesting processor on the source list and, if it is there, remove it.
(C) If an alternate source is provided, add it to the source list for the True File registry entry record 140 .
(D) If the source list of the True File registry entry record 140 has no items in it, use the Locate Remote File primitive mechanism to search for another copy of the file. If it fails, raise a serious error.
5. Cancel Reservation
This mechanism allows a remote processor to indicate that it no longer requires access to a True File stored on the local processor. It begins with a True Name and a requesting processor ID and proceeds as follows:
(A) Find the True Name entry in the True File registry 126 . If there is no entry for this True Name, this mechanism's task is complete.
(B) Remove the identity of the requesting processor from the list of dependent processors, if it appears.
(C) If the list of dependent processors becomes zero and the use count is also zero, delete the True File.
6. Acquire True File
This mechanism allows a remote processor to insist that a local processor make a copy of a specified True File. It is used, for example, when a cache client wants to write through a new version of a file. The Acquire True File mechanism begins with a data item and an optional True Name for the data item and proceeds as follows:
(A) Confirm that the requesting processor has the right to require the local processor to acquire data items. If not, send a negative reply.
(B) Make a local copy of the data item transmitted by the remote processor.
(C) Assimilate the data item into the True File registry of the local processor.
(D) If a True Name was provided with the file, the True Name calculation can be avoided, or the mechanism can verify that the file received matches the True Name sent.
(E) Add an entry in the dependent processor list of the true file registry record indicating that the requesting processor depends on this copy of the given True File.
(F) Send a positive reply.
7. Lock Cache
This mechanism allows a remote cache client to lock a local file so that local users or other cache clients cannot change it while the remote processor is using it. The mechanism begins with a pathname and proceeds as follows:
(A) Find the local directory extensions table entry record 138 of the specified pathname. If no such entry exists, reply negatively.
(B) If an local directory extensions table entry record 138 exists and is already locked, reply negatively that the file is already locked.
(C) If an local directory extensions table entry record 138 exists and is not locked, lock the entry. Reply positively.
8. Update Cache
This mechanism allows a remote cache client to unlock a local file and update it with new contents. It begins with a pathname and a True Name. The file corresponding to the True Name must be accessible from the remote processor. This mechanism operates as follows:
Find the local directory extensions table entry record 138 corresponding to the given pathname. Reply negatively if no such entry exists or if the entry is not locked.
Link the given pathname to the given True Name using the Link Path to True Name primitive mechanism.
Unlock the local directory extensions table entry record 138 and return positively.
9. Check Expiration Date
Return current or new expiration date and possible alternative source to caller.
Background Processes and Mechanisms
The background processes and mechanisms provided by the present invention are now described. Recall that background mechanisms are intended to run occasionally and at a low priority to provide automated management capabilities with respect to the present invention.
The following background mechanisms are described:
1. Mirror True File;
2. Groom Region;
3. Check for Expired Links;
4. Verify Region; and
5. Groom Source List.
1. Mirror True File
This mechanism is used to ensure that files are available in alternate locations in mirror groups or archived on archival servers. The mechanism depends on application-specific migration/archival criteria (size, time since last access, number of copies required, number of existing alternative sources) which determine under what conditions a file should be moved. The Mirror True File mechanism operates as follows, using the True File specified, perform the following steps:
(A) Count the number of available locations of the True File by inspecting the source list of the True File registry entry record 140 for the True File. This step determines how many copies of the True. File are available in the system.
(B) If the True File meets the specified migration criteria, select a mirror group server to which a copy of the file should be sent. Use the Acquire True File remote mechanism to copy the True File to the selected mirror group server. Add the identity of the selected system to the source list for the True File.
2. Groom Region
This mechanism is used to automatically free up space in a processor by deleting data items that may be available elsewhere. The mechanism depends on application-specific grooming criteria (for instance, a file may be removed if there is an alternate online source for it, it has not been accessed in a given number of days, and it is larger than a given size). This mechanism operates as follows:
Repeat the following steps (i) to (iii) with more aggressive grooming criteria until sufficient space is freed or until all grooming criteria have been exercised. Use grooming information to determine how much space has been freed. Recall that, while grooming is in effect, grooming information includes a table of pathnames selected for deletion, and keeps track of the amount of space that would be freed if all of the files were deleted.
(i) Begin Grooming (using the primitive mechanism).
(ii) For each pathname in the specified region, for the True File corresponding to the pathname, if the True File is present, has at least one alternative source, and meets application specific grooming criteria for the region, select the file for removal (using the primitive mechanism).
(iii) End Grooming (using the primitive mechanism).
If the region is used as a cache, no other processors are dependent on True Files to which it refers, and all such True Files are mirrored elsewhere. In this case, True Files can be removed with impunity. For a cache region, the grooming criteria would ordinarily eliminate the least recently accessed True Files first. This is best done by sorting the True Files in the region by the most recent access time before performing step (ii) above. The application specific criteria would thus be to select for removal every True File encountered (beginning with the least recently used) until the required amount of free space is reached.
3. Check for Expired Links
This mechanism is used to determine whether dependencies on published files should be refreshed. The following steps describe the operation of this mechanism:
For each pathname in the specified region, for each True File corresponding to the pathname, perform the following step:
If the True File registry entry record 140 corresponding to the True File contains at least one source which is a publishing server, and if the expiration date on the dependency is past or close, then perform the following steps:
(A) Determine whether the True File registry entry record contains other sources which have not expired.
(B) Check the True Name expiration of the server. If the expiration date has been extended, or an alternate source is suggested, add the source to the True File registry entry record 140 .
(C) If no acceptable alternate source was found in steps (A) or (B) above, make a local copy of the True File.
(D) Remove the expired source.
4. Verify Region
This mechanism can be used to ensure that the data items in the True File registry 126 have not been damaged accidentally or maliciously. The operation of this mechanism is described by the following steps:
(A) Search the local directory extensions table 124 for each pathname in the specified region and then perform the following steps:
The source list in a True File entry should be groomed sometimes to ensure there are not too many mirror or archive copies. When a file is deleted or when a region definition or its mirror criteria are changed, it may be necessary to inspect the affected True Files to determine whether there are too many mirror copies. This can be done with the following steps:
For each affected True File,
(A) Search the local directory extensions table to find each region that refers to the True File.
(B) Create a set of “required sources”, initially empty.
(C) For each region found,
(D) For each source in the True File registry entry, if the source identifies a remote processor (as opposed to removable media), and if the source is not a publisher, and if the source is not in the set of required sources, then eliminate the source, and use the Cancel Reservation remote mechanism to eliminate the given processor from the list of dependent processors recorded at the remote processor identified by the source.
Extended Mechanisms
The extended mechanisms provided by the present invention are now described. Recall that extended mechanisms run within application programs over the operating system to provide solutions to specific problems and applications.
The following extended mechanisms are described:
1. Inventory Existing Directory;
2. Inventory Removable, Read-only Files;
3. Synchronize Directories;
4. Publish Region;
5. Retire Directory;
6. Realize Directory at Location;
7. Verify True File;
8. Track for Accounting Purposes; and
9. Track for Licensing Purposes.
1. Inventory Existing Directory
This mechanism determines the True Names of files in an existing on-line directory in the underlying operating system. One purpose of this mechanism is to install True Name mechanisms in an existing file system.
An effect of such an installation is to eliminate immediately all duplicate files from the file system being traversed. If several file systems are inventoried in a single True File registry, duplicates across the volumes are also eliminated.
(A) Traverse the underlying file system in the operating system. For each file encountered, excluding directories, perform the following:
A system with access to removable, read-only media volumes (such as WORM disks and CD-ROMs) can create a usable inventory of the files on these disks without having to make online copies. These objects can then be used for archival purposes, directory overlays, or other needs. An operator must request that an inventory be created for such a volume.
This mechanism allows for maintaining inventories of the contents of files and data items on removable media, such as diskettes and CD-ROMs, independent of other properties of the files such as name, location, and date of creation.
The mechanism creates an online inventory of the files on one or more removable volumes, such as a floppy disk or CD-ROM, when the data on the volume is represented as a directory. The inventory service uses a True Name to identify each file, providing a way to locate the data independent of its name, date of creation, or location.
The inventory can be used for archival of data (making it possible to avoid archiving data. When that data is already on a separate volume), for grooming (making it possible to delete infrequently accessed files if they can be retrieved from removable volumes), for version control (making it possible to generate a new version of a CD-ROM without having to copy the old version), and for other purposes.
The inventory is made by creating a volume directory in the media inventory in which each file