This invention relates generally to performing a reverse lookup in a map data structure.
The increase in the amount of data stored on digital computing systems has resulted in complex storage systems with data often distributed over multiple physical nodes or storage devices. One method for organizing data has been to store them in files. These files are then grouped into directories with some directories including other directories and/or files. Typically, files and directories are assigned unique identifiers within the file system. In most systems, files and directories are arranged in order to optimize the lookup of a unique identifier given the particular path or name of the file or directory (such as for a downward lookup).
Examples of mapping structures used to organize files and directories in this manner include B-trees, B+trees, Patricia tries, red-black trees, and flat-file directories. However, these types of systems often make the lookup of the path in response to the unique identifier computationally expensive because an examination of many more nodes is required in order to identify the desired file or directory (such as for a reverse lookup).
Because of the foregoing challenges and limitations, there is a need to provide a more efficient manner in which to perform a reverse lookup in a map data structure.
The embodiments disclosed herein generally relate to performing a reverse lookup in a map data structure.
In one embodiment, a process for reverse lookups between a map structure and a structure being referenced by the map structure comprises receiving a structure that includes a reference to the structure and a reverse lookup hint; locating one or more entries in a map structure that correspond to the reverse lookup hint; and identifying at least one matching entry in the map structure that corresponds to the structure.
In another embodiment, a method for reverse lookups between a map structure and a structure being referenced by the map structure comprises storing in a map structure at least one reference to a structure and a name associated with the structure; and storing in the structure the at least one reference and a reverse lookup hint to locate the reference in the map structure.
In yet another embodiment, a data structure for reverse lookups comprises a reference to a data structure; and a reverse lookup hint to locate one or more entries in a map structure that correspond to the data structure, the one or more entries including the reference to the data structure and a name corresponding to the data structure.
In a further embodiment, a distributed file system configured to perform reverse lookups between a map structure and a structure being referenced by the map structure comprising an at least one storage device configured to store data. The data comprises a map structure which comprises a reference to a structure and at least one name associated with the structure; and the structure which comprises the reference and a reverse lookup hint that is used to locate the reference to the structure in the map structure.
For purposes of summarizing this invention, certain aspects, advantages, and novel features of the invention have been described herein. It is to be understood that not necessarily all such advantages may be achieved in accordance with any particular embodiment of the invention. Thus, the invention may be embodied or carried out in a manner that achieves or optimizes one advantage or group of advantages as taught herein without necessarily achieving other advantages as may be taught or suggested herein.
Systems, methods, processes, and data structures which represent one embodiment of an example application of the invention will now be described with reference to the drawings. Variations to the systems, methods, processes, and data structures which represent other embodiments will also be described.
For purposes of illustration, some embodiments will be described in the context of a distributed file system. Embodiments of a distributed file system suitable for accommodating reverse lookup requests are disclosed in U.S. patent application Ser. No. 10/007,003, titled, “SYSTEMS AND METHODS FOR PROVIDING A DISTRIBUTED FILE SYSTEM UTILIZING METADATA TO TRACK INFORMATION ABOUT DATA STORED THROUGHOUT THE SYSTEM,” filed Nov. 9, 2001 which claims priority to Application No. 60/309,803 filed Aug. 3, 2001, U.S. patent application Ser. No. 10/281,467 entitled “SYSTEMS AND METHODS FOR PROVIDING A DISTRIBUTED FILE SYSTEM INCORPORATING A VIRTUAL HOT SPARE,” filed Oct. 25, 2002, and U.S. patent application Ser. No. 10/714,326 entitled “SYSTEMS AND METHODS FOR RESTRIPING FILES IN A DISTRIBUTED FILE SYSTEM,” filed Nov. 14, 2003, which claims priority to Application No. 60/426,464, filed Nov. 14, 2002, all of which are hereby incorporated by reference herein in their entirety.
In one embodiment of a distributed file system, metadata structures, also referred to as inodes, are used to monitor and manipulate the files and directories within the system. An inode is a data structure that describes a file or directory and may be stored in a variety of locations including on disk and/or in memory. The inode in-memory may include a copy of the on-disk data plus additional data used by the system, including fields associated with the data structure.
Some of the figures and descriptions relate to an embodiment of the invention wherein the environment is that of a distributed file system. The present invention is not limited by the type of environment in which the systems, methods, structures, and processes are used, however, and may be used in other environments, such as, for example, other file systems, other distributed systems, the Internet, the World Wide Web, a private network for a hospital, a broadcast network for a government agency, an internal network of a corporate enterprise, an Internet, a local area network, a wide area network, a wired network, a wireless network, and so forth. It is also recognized that in other embodiments, the systems, methods, structures and processes may be implemented as a single module and/or implemented in conjunction with a variety of other modules and the like.
I. Overview
In one embodiment, a user or client device is connected to a distributed file system comprised of one or more physical nodes (for example, storage devices). The data on each of the physical nodes are arranged according to inodes which store metadata about files and directories within the file system. Typically, when a client device desires to access a specific file stored on the distributed file system, the client device requests the file by its name or some other mutable identifier. Then, the system performs a downward lookup in order to identify the inode that corresponds to the file.
As used herein, a file is a collection of data stored in one unit under an inode or filename. A directory, similar to a file, is a collection of data stored in one unit under an inode or directory name. A directory, however, is a specialized collection of data regarding elements in a file system. In one embodiment, a file system is organized in a tree-like structure. Directories are organized like the branches of trees. Directories may begin with a root directory and/or may include other branching directories. Files resemble the leaves or the fruit of the tree. Files, typically, do not include other elements in the file system, such as files and directories. In other words, files do not typically branch. Although in the illustrated embodiment an inode represents either a file or a directory, in other embodiments, an inode may include metadata for other elements in a distributed file system, in other distributed systems, in other file systems, or other systems.
Some client devices may dispatch a listener that awaits event notifications on a particular inode. In one embodiment, event notifications may be generated and received according to the systems and methods disclosed in U.S. patent application Ser. No. 11/396,282, titled, “SYSTEMS AND METHODS FOR NOTIFYING LISTENERS OF EVENTS,” and is hereby incorporated by reference in its entirety. For example, the client may be a directory management application. When the directory management application opens a window on a particular directory, it instantiates a listener on that directory. When another application, such as a word processor, creates a new file in that directory, the event system notifies the listening application, which updates the window to show the new file.
When an event notification system receives a notification on a particular inode, it returns the unique identifier that corresponds to the inode. Thus, in order to communicate the name or global path to a user or client application, a reverse lookup is needed. It is also recognized that the need for a name associated with an inode may arise in a variety of other contexts.
The embodiments disclosed herein may be implemented on a file system that includes directories represented by a map data structure, where each map data structure may include billions of entries. In some implementations, the systems and methods, structures and processes for a reverse lookup disclosed herein may dramatically reduce the time required to identify the name associated with files and directories and thereby improve overall system efficiency.
II. System Architecture
In
In the embodiment depicted, the physical nodes are either interfaces 110, 120, such as a personal computer, a mainframe terminal or a client application, or data storage systems 130, 140, 150. It will be appreciated by one with ordinary skill in the art that the distributed file system 100 may comprise one or a plurality of interfaces and one or a plurality of data storage systems. In some embodiments, the interfaces 110, 120 may comprise data storage systems such as, for example, data storage systems 130, 140 and 150.
As used herein, the word module refers to logic embodied in hardware or firmware, or to a collection of software instructions, possibly having entry and exit points, written in a programming language, such as, for example, C or C++. A software module may be compiled and linked into an executable program, installed in a dynamic link library, or may be written in an interpreted programming language such as, for example, BASIC, Perl, or Python. It will be appreciated that software modules may be callable from other modules or from themselves, and/or may be invoked in response to detected events or interrupts. Software instructions may be embedded in firmware, such as an EPROM. It will be further appreciated that hardware modules may be comprised of connected logic units, such as gates and flip-flops, and/or may be comprised of programmable units, such as programmable gate arrays or processors. The modules described herein are preferably implemented as software modules, but may be represented in hardware or firmware. Moreover, although in some embodiments a module may be separately compiled, in other embodiments a module may represent a subset of instructions of a separately compiled program, and may not have an interface available to other logical program units.
In one embodiment, the directory module 218, 248, 278 assigns to each link between inodes a key. The key serves as a unique identifier within a particular directory map structure. When the processor 212, 242, 272 receives an event notification related to an inode, the processor 212, 242, 272 communicates the relevant inode identifier or LIN to the reverse lookup module 210, 240, 270. The reverse lookup module 210, 240, 270 accesses the storage device 220, 250, 280 in order to efficiently perform the reverse lookup operation in the particular directory map structure and return the name associated with the link(s) to the inode.
The data structures stored in the storage devices 220, 250, 280 correspond to, by way of example only, the inode arrangement depicted in
The data storage devices 220, 250, 280 also store a mapping data structure for every inode that corresponds to a directory in the distributed file system 100. In the embodiments described herein, the mapping structure is implemented using a B-tree structure. It will be appreciated by one of ordinary skill in the art, however, that other data structures may be used such as, for example, B+-trees, Patricia tries, red-black trees and flat-file directories. In the depicted embodiment, the number of B-tree blocks stored for each directory inode depend on the number of links stored in the B-tree, and the height of the B-tree depends upon the number of B-tree blocks. For example, as shown in
Data structures are collections of associated data elements, such as a group or set of variables or parameters. In one embodiment a structure may be implemented as a C-language “struct.” One skilled in the art will appreciate that many suitable data structures may be used.
While
In one embodiment, the data storage systems 130, 140, 150 may run on a variety of computer systems such as, for example, a computer, a server, a smart storage unit, a mobile telephone, a handheld device, an embedded device, and so forth. In one embodiment, the computer may be a general purpose computer using one or more microprocessors, such as, for example, a Pentium® processor, a Pentium® II processor, a Pentium® Pro processor, a Pentium® IV processor, a Pentium® D processor, a Pentium® Core™ processor, an xx86 processor, an 8051 processor, a MIPS processor, a Power PC processor, a SPARC processor, an Alpha processor, and so forth. The computer may run a variety of operating systems that perform standard operating system functions such opening, reading, writing, and closing a file. It is recognized that other operating systems may be used, such as, for example, Microsoft® Windows® 3.X, Microsoft® Windows 98, Microsoft® Windows® 2000, Microsoft® Windows® NT, Microsoft® Windows® CE, Microsoft® Windows® ME, Microsoft® Windows® XP, Palm Pilot OS, Apple® MacOS®, Disk Operating System (DOS), UNIX, IRIX, Solaris, SunOS, FreeBSD, Linux®, or IBM® OS/2® operating systems.
III. Key Creation
Referring to
Hash_Value=REM( (Hash_Input)/(Divisor))
For example, if the number 7 is used as the Divisor, the following table illustrates an example of Hash_Values that correspond to the following Hash_Inputs:
As shown, there is not a one-to-one correspondence between each Hash_Value and each Hash_Input. In other words, more than one file or directory name may hash to the same Hash_Value. The use of a hash function to provide the hint is advantageous. In particular, it is preferable for a distributed file systems to store a key that comprises the hint rather than the name of a file or directory because the key is smaller than a filename and is of a fixed size. Additionally, in other embodiments, the hash function may use a different divisor such as 3, 87, 859 or 7,877. In yet other embodiments, the hash function may be the same as or similar to those disclosed in Knuth, D., The Art Of Computer Programming, Vol. 3: Sorting and Searching, Chap. 6.4 (Addison Wesley 1973) which is hereby incorporated by reference in its entirety herein. In further embodiments, the hint may be created using another function known to one with ordinary skill in the art of hash-based data structures.
After the hint is created, the method creates a key 400 with a default number of zero 320. In the embodiment depicted in
In other embodiments, the key 400, hint 410, and sequence number 420 may be represented by more or fewer binary bits, be represented by hexadecimal digits, ASCII characters, and so forth. In yet other embodiments, the key may additionally be comprised of values other than and/or in addition to those that correspond to the hint and sequence number. For ease of reference, a specific key value will be referred to herein using the following convention: (Hint, Sequence_Number).
In step 325, a lookup operation is performed to determine if another link from the parent has been assigned the same key as the one created in step 320. If no links have the same key 400 as the one created in step 320, the method returns the key 400 in step 340 before ending 345.
However, if another link in the parent directory has the same key 400 as the one created in step 320, the sequence number 420 is incremented in step 330. After incrementing the sequence number 420, step 325 is repeated to determine if another link in the parent directory 100 has the new key 400. If one exists, the sequence number 420 is incremented 330 until the key 400 assigned to the link is a unique key 400 within the parent directory 100.
For example, suppose Files A, B, C, and D are created in the recited order and are the first files created in a given directory. Also suppose that the links to Files A-D correspond to Hash_Values 2, 6, 2, and 2, respectively. For the link to File A, the key is (2,0) because the Hash_Value is 2 and no other files exist on the system with the same key. For the link to File B, the key is (6,0) because the Hash_Value is 6 and no other files exist on the system with the same key. For the link to File C, the key will begin as (2,0) because the Hash_Value is 2 and the sequence number is initialized to zero. However, because the link to File A has the same key, the sequence number will be incremented. Consequently, the key assigned to the link to File C will be (2,1) because no other links from the parent directory have the same key. For the link to File D, the key will begin as (2,0) because the Hash_Value is 2 and the sequence number is initialized to zero. However, because the link to File A has the same key, the sequence number will be incremented such that the key is (2,1). The system will then increment the sequence number again because the link to File C has the same key. Therefore, the key (2,2) is assigned to the link to File D.
While
It is recognized that in other embodiments, the key may be created without the use of a hash function. In yet other embodiments, keys may be assigned without the use of a sequence number.
IV. Inode Arrangement
Inode one 510 is the top-most directory in the system and in the embodiment of a file system is referred to as the root directory. Inode one 510 has two child inodes, inodes two 520 and three 530, and six grandchild inodes, inodes four through nine 540, 550, 560, 570, 580, 590. Inode one 510 will be referred to as the parent of inodes two 520 and three 530, and the grandparent of inodes four through nine 540, 550, 560, 570, 580, 590.
As a parent inode, inode one 510 references its children. In the depicted example, it references inode two 520 via pointer 515 and references inode three 530 via pointer 525. The name associated with the link to inode two 520, “docs,” is noted alongside pointer 515. Also indicated is the reverse lookup hint associated with and derived from the name of the link to inode two 520, “4.” Accordingly, the global path for inode two 520 is “/docs”. In one embodiment, the metadata for an inode includes information about each of the inode's parent(s). For example, the metadata stores a Parent(Count) that indicates the LINs of each parent of the inode and the number of links to each parent. In some embodiments, this information may include the inode's full path name(s), however, storing and updating this information can be time consuming. Thus, in some embodiments, the inodes store information, such as for example, a “reverse lookup hint” that allows the system to determining the inode's path name(s).
As used herein, a “reverse lookup hint” is associated with each name of, or synonymously, each link to, an inode. As described above, the hint may be the hash value of the name of the corresponding file or directory. Thus, there is a hint and a reverse lookup hint for each existing link to an inode. In some embodiments, the reverse lookup hint may be one of the hints, the hint plus a portion of the sequence number, a portion of the hint, the hint and the sequence number, the key, or an arbitrarily assigned value.
A “reverse lookup hint” is used to narrow the search range during reverse lookup operations. In one embodiment, the reverse lookup hint refers to the hint associated with the first-created link to an inode. That is, if the link that corresponds to the reverse lookup hint is later destroyed, the reverse lookup hint stored in the inode's metadata structure will nonetheless remain unchanged. In other embodiments, however, the reverse lookup hint may change in response to destroyed or newly created links. In yet other embodiments, inodes may store reverse lookup hints associated with the last created link to the inode, every link to the inode, a subset of every link to the inode, every parent of the inode, or only some of the parents of the inode.
As indicated above, inode two 520 has three children. Pointers 519, 528, 531 and 538 point to each of the child inodes. Because the children 540, 550, 590 of inode two 520 are files, they do not have any children. Thus, they may also be referred to as leaf inodes.
In the embodiment depicted in
In another embodiment, leaf inodes may only be linked from a single parent inode. In other embodiments, a directory inode may be multiply linked from its parent inodes. In yet other embodiments, directories may be linked from more than one parent inode and/or files may have child inodes.
The following table summarizes the inode arrangement depicted in
Additionally, inode three 530 points to inode seven 570 via pointer 577. As indicated by the dashed line, inode three 530 initially pointed to inode seven 570 via pointer 578. However, that link 578 was destroyed. In the illustrated embodiment, the reverse lookup hint assigned to an inode corresponds to the first-created link to that inode. Accordingly, because the link to inode seven 570 via pointer 578 was created before the link indicated by pointer 577, the reverse lookup hint for inode seven 570 remains 34. As used herein, when the reverse lookup hint to an inode does not correspond to an existing link to that inode, it is referred to as a “stale hint.” In other embodiments, the distributed file system 100 updates the reverse lookup hint every time a link is destroyed so as to eliminate stale hints.
V. Metadata
The metadata structure comprises a plurality of fields that include information about the inode. For example, fields in inode 600 may include, but are not limited to, the mode 601; the LIN 602; an array of parents, each indicating the number of links from that parent, referred to as the “Parent (Count)” 603; and the reverse lookup hint 604.
The mode field 601 indicates, for example, whether the inode corresponds to a file or a directory.
The LIN field 602, or Logical Inode Number field, refers to a unique identifier for the file or directory. It uniquely refers to the on-disk data structures for the file or directory. For inode one 510, the LIN is 1. As used herein, inodes are referred to using their LIN.
The Parent (Count) field 602 refers to the parents of the inode and the number of links, that is, counts, from each parent. For example, inode one 510 has no parents because it is the root-directory. Accordingly, a null value is stored in the Parent (Count) 602 field. In other embodiments, a zero value or another value may be stored in the Parent (Count) field 602 of the root inode 510.
However, inode four 540 has two parents, inodes two 520 and three 530, and is multiply linked from parent inode two 520. Therefore, the value stored in the Parent (Count) field 633 of metadata structure 630 is “2(2), 3(1).” The value stored in Parent (Count) field 633 indicates that inode four 540 has two links from parent inode two 520 and one link from parent inode three 530. It will be recognized by one with skill in the art that the Parent (Count) value may be stored in any number of ways such as, for example, a binary representation, a linked list, or an array.
Also, for inode seven 570, the value stored in the Parent (Count) field 663 of metadata structure 660 is “3(1).” The value stored in Parent (Count) field 660 indicates that only one link exists between inode three 530 and inode seven 540. In other words, the Parent (Count) field 663 reflects that the link associated with pointer 578 was destroyed.
The reverse lookup hint field 603 refers to the hint used by the reverse lookup operation to identify the name associated with a particular inode. For exemplary inode one 510, a null value is stored in the reverse lookup hint field 604 because inode one 510 is the root directory. In other embodiments, the reverse lookup hint may be a zero or a value representative of the root directory. For the other inodes, the reverse lookup hint corresponds to the hint associated with the first-created link to the inode.
For example, the value stored in the reverse lookup hint field 634 for inode four 540 is 27 because the link indicated by pointer 528 was created before the links indicated by pointers 519 and 526. Additionally, the value stored in the reverse lookup hint field 664 for inode seven 570 is 34 because it is a stale hint corresponding to the first-created and subsequently destroyed link indicated by pointer 578. As stated above, because the depicted embodiment does not update the reverse lookup hint in response to destroyed links, the reverse lookup hint remains 34 even though the hint associated with the only existing link is 109. Though updating the hint in response to destroyed links is computationally expensive, some embodiments may do so.
The following table summarizes a portion of the data stored in metadata structures 600, 610, 620, 630, 640, 650, 660, 670, and 680:
VI. Mapping Structures
VII. Reverse Lookup
If the user wishes to return only one name for the current entry in decision block 810, the reverse lookup operation calls, in block 880, subprocess “Determine Name for Single Count” 900 which will be described in more detail below. Subprocess “Determine Name for Single Count” 900 returns one name associated with a link to the current entry. Next, in decision block 870, the reverse lookup operation queries the user or client application as to whether the global path for the link to the current entry is desired.
If the global path is not desired, the operation ends 895.
However, if the global path is desired, the reverse lookup operation 800 calls subprocess “Determine Global Path” 1100 in block. 890. Subprocess “Determine Global Path” 1100 is described in more detail below. After returning the global path, the reverse lookup operation ends 895.
If, however, in block 810, all names associated with the current entry are desired, the reverse lookup operation 800 performs a for loop for each parent in the Parent (Count) of the current entry 820. For each parent, the reverse lookup operation 800 determines in decision block 830 whether the particular parent has more than one count. If the parent has more than one count, the reverse lookup operation 800 calls subprocess “Determine Name for Multiple Counts” 1000 in block 840. “Determine Name for Multiple Counts” 1000 returns the name for each link between the current entry and the particular parent of the current entry. However, if the parent has only one count, the reverse lookup operation 800 calls subprocess “Determine Name for Single Count” 900 in block 850. As stated above, “Determine Name for Single Count” 900 returns the name of the single link between the current entry and the parent of the current entry. After the names for every link to every parent have been returned, the for loop ends 860
Next, in decision block 870, the user or client application is queried as to whether the global path(s) of the link(s) to the current entry is desired.
Then, if the global path is not desired, the reverse lookup operation 800 ends 895.
However, if the global path is desired, the reverse lookup operation 800 calls subprocess “Determine Global Path” 1100. After the global path of every name of the current entry has been returned by subprocess 1100, the reverse lookup operation 800 ends 895.
It will be appreciated by one with skill in the art that the invention disclosed herein is not limited to the sequence of steps depicted in
A. Determine Name for Single Count
In block 925, the reverse lookup hint determines a range of entries that could include the current entry. In the illustrated embodiment, the initial range of entries is based on the reverse lookup hint and spans the following set of keys: [(Reverse Lookup Hint, 0), (Reverse Lookup Hint +1, 0)). That is, in one embodiment, the range of entries includes all keys with the reverse lookup hint. Thus, when the reverse lookup hint is not a stale hint or a hint for a link to another parent, the current entry will be found in the initial range of entries. Using a reverse lookup hint rather than searching every entry in the B-tree may reduce the amount of time needed to identify a matching entry.
In embodiments where the reverse lookup hint is the hint 400, the initial range will include entries with keys that vary only by sequence number. In other embodiments, variations in the relationship between the hint and the reverse lookup hint may affect the range of entries. For example, if the reverse lookup hint represents only a portion of the hint, the range will be wider. However, if the reverse lookup hint represents the hint plus a portion of the sequence number, the range will be narrower.
After the range is determined, the subprocess determines whether an entry in the range of entries has the same LIN as the current entry 930. If an entry in the range has a matching LIN, the subprocess 900 returns the LIN of the currently examined parent of the matching entry (that is, the “current parent”) and the name or identifier associated with the matching entry 940. In other embodiments, only the name of the matching entry or the LIN is returned. In yet other embodiments, other information associated with the link to the matching entry may be returned.
However, if, in decision block 930, no entry in the range has a LIN that matches the current entry, the range of entries is expanded to include all possible entries in the B-tree structure for the parent inode 935. That is, the range of entries becomes [0, inf.]. Then, the operation in block 945 is performed in order to find a matching entry within the new range. If found, subprocess 900 returns the LIN of the current parent and the name of the matching entry 940.
In some embodiments, though unexpected, if the subprocess 900 is unable to identify a matching entry amongst all of the entries in the B-tree structure 945, the subprocess 900 indicates that the Parent (Count) field includes erroneous information (for example, by returning: “Error In Parent Count”) 950 before ending 985. It is recognized that not all possible error conditions have been discussed with regard to the determine name for a single count process 900 and the other processes described herein. However, a person with ordinary skill in the art would be able to contemplate and account for these other possible error conditions.
While
B. Determine Name for Multiple Counts
In block 1035, the subprocess 1000 initiates a for loop for every entry in the B-tree structure associated with the current parent. In other words, every entry in the parent directory is considered. For every entry, the subprocess 1000 determines whether the LIN of the entry matches the LIN of the current entry 1040. If the entry is a matching entry, the subprocess 1000 gets and returns the name of the entry 1060 and then increments COUNT_CTR 1065. If COUNT_CTR is not equal to COUNT_TOTAL 1070, then subprocess 1000 considers the next entry in the for loop and determines if the next entry is a matching entry 1040. The subprocess 1000 returns the name of all matching entries 1060 and increments COUNT_CTR 1065 accordingly. Thus, when COUNT_CTR is equal to COUNT_TOTAL 1070, the for loop breaks 1075. Then, the subprocess 1000 gets and returns the LIN of the current parent 1055 before ending 1080.
However, though unexpected, if the for loop considers every entry in the B-tree structure before COUNT_CTR is equal to COUNT_TOTAL 1070, the for loop ends 1045. Then, the subprocess 1000 indicates that there is erroneous information stored in the Parent (Count) field of the metadata structure. In the illustrated embodiment, the subprocess 1000 will return “Error in Parent Count” 1050. Then, the subprocess 1000 gets and returns the LIN of the current parent 1055 before ending 1080. It is recognized that not all possible error conditions have been discussed with regard to the determine name for multiple counts process 1000 and the other processes described herein. However, a person with ordinary skill in the art would be able to contemplate and account for these other possible error conditions.
While
C. Determine Global Path
If, in decision block 870 of
However, if the parent of the current entry is not the root 1115, the parent of the current entry is designated the current entry 1125, and the subprocess “Determine Name for Single Count” 900 is called in block 1130. In the illustrated embodiment, every inode associated with a directory has only one link from one parent inode. Therefore, “Determine Name for Single Count” 900 is suitable for determining the name associated with the parents of directory inodes. In other embodiments, directory inodes may have multiple links to a parent inode or links to more than one parent inode. For these embodiments, one of ordinary skill in the art will recognize that the subprocess 1100 illustrated in
After subprocess “Determine Name for Single Count” 900 executes, the subprocess 1100 prepends the returned name to the particular global path 1120 and determines whether the parent of the current entry is the root 1115. If it is, the particular global path is returned 1140. However, if it is not, the subprocess 1100 iteratively determines the name of every successive parent inode 1125, 1130 in the particular global path until it reaches an inode whose parent is the root 1115.
After the subprocess 1100 returns the global path for the first returned name 1140, the subprocess 1100 similarly returns the global path for every returned name. After the global path of all names have been returned 1140, the for loop 1145 and subprocess 1100 end 1150.
While
VIII. Exemplary Applications
Referring, to
A. Hint Collisions
Inode five 550 in
Referring to
Next, the subprocess 900 examines the two entries (that is, the two entries with a hint collision) within the specified range, entries corresponding to links to inodes four 540 and five 550. It determines that an entry within the range has a LIN that matches the LIN 930 for inode five 550. Accordingly, subprocess 900 returns the LIN of the current parent and the name of the matching entry. Therefore, subprocess 900 returns the following:
After subprocess 900 finishes executing in block 880 of
Referring to
First, the subprocess 1100 prepends the name “/saved.txt” to the global path 1120. Then, the subprocess 1100 determines that the parent of inode five 550 is not the root 1115. Next, the parent inode of inode five 550, inode two 520, becomes the current entry 1125.
In block 1130, the subprocess 1100 calls subprocess “Determine Name for Single Count” 900 using inode two 520 as the current entry. “Determine Name for Single Count” 900, using reverse lookup hint: 4, LIN: 2, and a Parent (Count): 1(1), determines from the B-tree structure depicted in
Next, the subprocess prepends “/docs” to the global path 1120 and determines that the parent of inode two 520 is the root 1115. Accordingly, subprocess 1100 returns the global path. Therefore, subprocess 1100 returns the following:
B. Multiply Linked Files
Inode four 540 in
For inode three 530, the reverse look up operation determines that the parent has only one count 830 and will execute the subprocess “Determine Name for Single Count” 900 using the reverse lookup hint “27” from the Reverse Lookup Hint field 634 of
Then, the subprocess determines that entry 724 is a matching entry because LIN “4” is equal to the LIN for inode four 540. Accordingly, subprocess 900 returns the name of the matching entry and the LIN of the current parent 940. Therefore, subprocess 900 returns the following:
Next, the for loop 820 of
“Determine Name for Multiple Counts” 1000 assigns to COUNT_TOTAL the value “2” because parent inode two 520 has two links to inode four 540. Next, the subprocess 1000 searches all of the entries in the B-tree structure for inode two 520 and determines that the entries corresponding to keys (12, 0) and (27, 0) are matching entries 1040. Therefore, for each matching entry, the subprocess 1000 returns the name of the matching entry 1060 and increments the counter 1065. Because the counter has been incremented twice, COUNT_CTR is equal to COUNT_TOTAL 1070 and the for loop breaks 1075.
Next, in step 1055, the subprocess 1000 gets and returns the LIN of the current parent 1055. Therefore, subprocess 1000 returns the following:
Returning to
C. Stale Hint
Inode seven 570 in
Referring to
Referring to
In decision block 930, the subprocess 900 will determine whether there is a matching entry within the range that has the same LIN as the current entry. As shown in
Next, the subprocess will return the LIN of the parent inode and the name of the matching entry 940. Therefore, subprocess 900 returns the following:
Subprocess 900 will then end 985, and supposing the client application does not desire the global path 890, the reverse lookup operation 800 also ends 895.
IX. Other Embodiments
While certain embodiments of the invention have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the present invention. Accordingly, the breadth and scope of the present invention should be defined in accordance with the following claims and their equivalents.
By way of example, the following alternatives are also contemplated. Although the data structures described herein have been directed to a distributed file system, some embodiments of the invention may be used in a single file system. The reverse lookup may also be implemented in systems that do not include file systems such as, for example, in-memory lookup tables and databases. Additionally or alternatively, in the embodiments that comprise a historical flat-file directory, the offset of the directory entry may be used as the reverse lookup hint. Further, directories structured according to Patricia tries and hash tables may also be used. Additionally, it is recognized that the reverse lookup hint may represent only a portion of the key when an ordered mapping structure such as, for example, a B-tree implementation is used. In contrast, the reverse lookup hint may represent the entire key when a non-ordered mapping structure such as, for example, a hash table implementation is used. The inherent properties of these structures present data values that may be used as reverse lookup hints. Alternatively, one of ordinary skill in the art will appreciate that the reverse lookup hint need not be explicitly used by the search data structure; rather, the reverse lookup hint may be present as a side-effect of the organization scheme used.
The above-mentioned alternatives are examples of other embodiments, and they do not limit the scope of the invention. It is recognized that a variety of data structures with various fields and data sets may be used. In addition, other embodiments of the flow charts may be used.
Number | Name | Date | Kind |
---|---|---|---|
5163131 | Row et al. | Nov 1992 | A |
5181162 | Smith et al. | Jan 1993 | A |
5230047 | Frey et al. | Jul 1993 | A |
5251206 | Calvignac et al. | Oct 1993 | A |
5258984 | Menon et al. | Nov 1993 | A |
5329626 | Klein et al. | Jul 1994 | A |
5359594 | Gould et al. | Oct 1994 | A |
5403639 | Belsan et al. | Apr 1995 | A |
5548724 | Akizawa et al. | Aug 1996 | A |
5596709 | Bond et al. | Jan 1997 | A |
5612865 | Dasgupta | Mar 1997 | A |
5657439 | Jones et al. | Aug 1997 | A |
5668943 | Attanasio et al. | Sep 1997 | A |
5694593 | Baclawski | Dec 1997 | A |
5696895 | Hemphill et al. | Dec 1997 | A |
5734826 | Olnowich et al. | Mar 1998 | A |
5761659 | Bertoni | Jun 1998 | A |
5774643 | Lubbers et al. | Jun 1998 | A |
5799305 | Bortvedt et al. | Aug 1998 | A |
5805578 | Stirpe et al. | Sep 1998 | A |
5805900 | Fagen et al. | Sep 1998 | A |
5806065 | Lomet | Sep 1998 | A |
5822790 | Mehrotra | Oct 1998 | A |
5862312 | Mann | Jan 1999 | A |
5870563 | Roper et al. | Feb 1999 | A |
5878410 | Zbikowski et al. | Mar 1999 | A |
5878414 | Hsiao et al. | Mar 1999 | A |
5884046 | Antonov | Mar 1999 | A |
5884098 | Mason, Jr. | Mar 1999 | A |
5884303 | Brown | Mar 1999 | A |
5890147 | Peltonen et al. | Mar 1999 | A |
5933834 | Aichelen | Aug 1999 | A |
5943690 | Dorricott et al. | Aug 1999 | A |
5996089 | Mann | Nov 1999 | A |
6021414 | Fuller | Feb 2000 | A |
6029168 | Frey | Feb 2000 | A |
6038570 | Hitz et al. | Mar 2000 | A |
6044367 | Wolff | Mar 2000 | A |
6055543 | Christensen et al. | Apr 2000 | A |
6070172 | Lowe | May 2000 | A |
6081833 | Okamoto et al. | Jun 2000 | A |
6081883 | Popelka et al. | Jun 2000 | A |
6108759 | Orcutt et al. | Aug 2000 | A |
6117181 | Dearth et al. | Sep 2000 | A |
6122754 | Litwin et al. | Sep 2000 | A |
6138126 | Hitz et al. | Oct 2000 | A |
6154854 | Stallmo | Nov 2000 | A |
6173374 | Heil et al. | Jan 2001 | B1 |
6209059 | Ofer et al. | Mar 2001 | B1 |
6219693 | Napolitano et al. | Apr 2001 | B1 |
6321345 | Mann | Nov 2001 | B1 |
6334168 | Islam et al. | Dec 2001 | B1 |
6353823 | Kumar | Mar 2002 | B1 |
6384626 | Tsai et al. | May 2002 | B2 |
6385626 | Tamer et al. | May 2002 | B1 |
6397311 | Capps | May 2002 | B1 |
6408313 | Campbell et al. | Jun 2002 | B1 |
6434574 | Day et al. | Aug 2002 | B1 |
6449730 | Mann et al. | Sep 2002 | B2 |
6453389 | Weinberger et al. | Sep 2002 | B1 |
6457139 | D'Errico et al. | Sep 2002 | B1 |
6502172 | Chang | Dec 2002 | B2 |
6502174 | Beardsley et al. | Dec 2002 | B1 |
6526478 | Kirby | Feb 2003 | B1 |
6546443 | Kakivaya et al. | Apr 2003 | B1 |
6549513 | Chao et al. | Apr 2003 | B1 |
6557114 | Mann | Apr 2003 | B2 |
6567894 | Hsu et al. | May 2003 | B1 |
6567926 | Mann | May 2003 | B2 |
6571244 | Larson | May 2003 | B1 |
6571349 | Mann | May 2003 | B1 |
6574745 | Mann | Jun 2003 | B2 |
6594655 | Tal et al. | Jul 2003 | B2 |
6594660 | Berkowitz et al. | Jul 2003 | B1 |
6598174 | Parks et al. | Jul 2003 | B1 |
6618798 | Burton et al. | Sep 2003 | B1 |
6662184 | Friedberg | Dec 2003 | B1 |
6671686 | Pardon et al. | Dec 2003 | B2 |
6671704 | Gondi et al. | Dec 2003 | B1 |
6732125 | Autrey et al. | May 2004 | B1 |
6848029 | Coldewey | Jan 2005 | B2 |
6907011 | Miller et al. | Jun 2005 | B1 |
6917942 | Burns et al. | Jul 2005 | B1 |
6922696 | Lincoln et al. | Jul 2005 | B1 |
6934878 | Massa et al. | Aug 2005 | B2 |
6940966 | Lee | Sep 2005 | B2 |
6954435 | Billhartz et al. | Oct 2005 | B2 |
7007044 | Rafert et al. | Feb 2006 | B1 |
7007097 | Huffman et al. | Feb 2006 | B1 |
7069320 | Chang et al. | Jun 2006 | B1 |
7111305 | Solter et al. | Sep 2006 | B2 |
7124264 | Yamashita | Oct 2006 | B2 |
7146524 | Patel et al. | Dec 2006 | B2 |
7152182 | Ji et al. | Dec 2006 | B2 |
7177295 | Sholander et al. | Feb 2007 | B1 |
7184421 | Liu et al. | Feb 2007 | B1 |
7228299 | Harmer et al. | Jun 2007 | B1 |
7240235 | Lewalski-Brechter | Jul 2007 | B2 |
7257257 | Anderson et al. | Aug 2007 | B2 |
7318134 | Oliveira et al. | Jan 2008 | B1 |
7373426 | Jinmei et al. | May 2008 | B2 |
7451341 | Okaki et al. | Nov 2008 | B2 |
7509448 | Fachan et al. | Mar 2009 | B2 |
20010047451 | Noble et al. | Nov 2001 | A1 |
20020035668 | Nakano et al. | Mar 2002 | A1 |
20020038436 | Suzuki | Mar 2002 | A1 |
20020055940 | Elkan | May 2002 | A1 |
20020072974 | Pugliese et al. | Jun 2002 | A1 |
20020075870 | de Azevedo et al. | Jun 2002 | A1 |
20020083078 | Pardon et al. | Jun 2002 | A1 |
20020087366 | Collier et al. | Jul 2002 | A1 |
20020095438 | Rising et al. | Jul 2002 | A1 |
20020124137 | Ulrich et al. | Sep 2002 | A1 |
20020138559 | Ulrich et al. | Sep 2002 | A1 |
20020156840 | Ulrich et al. | Oct 2002 | A1 |
20020156891 | Ulrich et al. | Oct 2002 | A1 |
20020156973 | Ulrich et al. | Oct 2002 | A1 |
20020156974 | Ulrich et al. | Oct 2002 | A1 |
20020156975 | Staub et al. | Oct 2002 | A1 |
20020161846 | Ulrich et al. | Oct 2002 | A1 |
20020161850 | Ulrich et al. | Oct 2002 | A1 |
20020161973 | Ulrich et al. | Oct 2002 | A1 |
20020163889 | Yemini et al. | Nov 2002 | A1 |
20020165942 | Ulrich et al. | Nov 2002 | A1 |
20020166026 | Ulrich et al. | Nov 2002 | A1 |
20020166079 | Ulrich et al. | Nov 2002 | A1 |
20020169827 | Ulrich et al. | Nov 2002 | A1 |
20020174295 | Ulrich et al. | Nov 2002 | A1 |
20020174296 | Ulrich et al. | Nov 2002 | A1 |
20020178162 | Ulrich et al. | Nov 2002 | A1 |
20020191311 | Ulrich et al. | Dec 2002 | A1 |
20020194523 | Ulrich et al. | Dec 2002 | A1 |
20020194526 | Ulrich et al. | Dec 2002 | A1 |
20020198864 | Ostermann et al. | Dec 2002 | A1 |
20030005159 | Kumhyr | Jan 2003 | A1 |
20030014391 | Evans et al. | Jan 2003 | A1 |
20030033308 | Patel et al. | Feb 2003 | A1 |
20030109253 | Fenton et al. | Jun 2003 | A1 |
20030120863 | Lee et al. | Jun 2003 | A1 |
20030125852 | Schade et al. | Jul 2003 | A1 |
20030131860 | Ashcraft et al. | Jul 2003 | A1 |
20030135514 | Patel et al. | Jul 2003 | A1 |
20030158873 | Sawdon et al. | Aug 2003 | A1 |
20030163726 | Kidd | Aug 2003 | A1 |
20030172149 | Edsall et al. | Sep 2003 | A1 |
20030182325 | Manely et al. | Sep 2003 | A1 |
20040003053 | Williams | Jan 2004 | A1 |
20040024963 | Talagala et al. | Feb 2004 | A1 |
20040133670 | Kaminksky et al. | Jul 2004 | A1 |
20040153479 | Mikesell et al. | Aug 2004 | A1 |
20040189682 | Troyansky et al. | Sep 2004 | A1 |
20040199734 | Rajamani et al. | Oct 2004 | A1 |
20040205141 | Goland | Oct 2004 | A1 |
20040230748 | Ohba | Nov 2004 | A1 |
20040260673 | Hitz et al. | Dec 2004 | A1 |
20050066095 | Mullick et al. | Mar 2005 | A1 |
20050114402 | Guthrie | May 2005 | A1 |
20050114609 | Shorb | May 2005 | A1 |
20050171960 | Lomet | Aug 2005 | A1 |
20050171962 | Martin et al. | Aug 2005 | A1 |
20050188052 | Ewanchuk et al. | Aug 2005 | A1 |
20050192993 | Messinger | Sep 2005 | A1 |
20050289169 | Adya et al. | Dec 2005 | A1 |
20050289188 | Nettleton et al. | Dec 2005 | A1 |
20060004760 | Clift et al. | Jan 2006 | A1 |
20060059467 | Wong | Mar 2006 | A1 |
20060074922 | Nishimura | Apr 2006 | A1 |
20060095438 | Fachan et al. | May 2006 | A1 |
20060101062 | Godman et al. | May 2006 | A1 |
20060129584 | Hoang et al. | Jun 2006 | A1 |
20060129631 | Na et al. | Jun 2006 | A1 |
20060129983 | Feng | Jun 2006 | A1 |
20060230411 | Richter et al. | Oct 2006 | A1 |
20060277432 | Patel | Dec 2006 | A1 |
20070091790 | Passey et al. | Apr 2007 | A1 |
20070094269 | Mikesell et al. | Apr 2007 | A1 |
20070094277 | Fachan et al. | Apr 2007 | A1 |
20070094310 | Passey et al. | Apr 2007 | A1 |
20070094431 | Fachan | Apr 2007 | A1 |
20070094452 | Fachan | Apr 2007 | A1 |
20070168351 | Fachan | Jul 2007 | A1 |
20070171919 | Godman et al. | Jul 2007 | A1 |
20070195810 | Fachan | Aug 2007 | A1 |
20070233684 | Verma et al. | Oct 2007 | A1 |
20070233710 | Passey et al. | Oct 2007 | A1 |
20080005145 | Worrall | Jan 2008 | A1 |
20080010507 | Vingralek | Jan 2008 | A1 |
20080021907 | Patel et al. | Jan 2008 | A1 |
20080031238 | Harmelin et al. | Feb 2008 | A1 |
20080034004 | Cisler et al. | Feb 2008 | A1 |
20080044016 | Henzinger | Feb 2008 | A1 |
20080046432 | Anderson et al. | Feb 2008 | A1 |
20080046443 | Fachan et al. | Feb 2008 | A1 |
20080046444 | Fachan et al. | Feb 2008 | A1 |
20080046445 | Passey et al. | Feb 2008 | A1 |
20080046475 | Anderson et al. | Feb 2008 | A1 |
20080046476 | Anderson et al. | Feb 2008 | A1 |
20080046667 | Fachan et al. | Feb 2008 | A1 |
20080059541 | Fachan et al. | Mar 2008 | A1 |
20080126365 | Fachan et al. | May 2008 | A1 |
20080154978 | Lemar et al. | Jun 2008 | A1 |
20080168458 | Fachan et al. | Jul 2008 | A1 |
Number | Date | Country |
---|---|---|
0774723 | May 1997 | EP |
WO 9429796 | Dec 1994 | WO |
WO 0057315 | Sep 2000 | WO |
WO 0114991 | Mar 2001 | WO |
WO 0133829 | May 2001 | WO |
WO 02061737 | Aug 2002 | WO |
WO 03012699 | Feb 2003 | WO |
WO 2004046971 | Jun 2004 | WO |
WO 2008021527 | Feb 2008 | WO |
WO 2008021528 | Feb 2008 | WO |
Number | Date | Country | |
---|---|---|---|
20080046445 A1 | Feb 2008 | US |