Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
CROSS-PROTOCOL LOCKING WITH A FILE SYSTEM
Document Type and Number:
WIPO Patent Application WO/2012/170004
Kind Code:
A1
Abstract:
A file system denies access to a particular file system object from a first file server protocol in response to a data structure referred to by an inode indicating that an access from a second different file server protocol of the particular file system object is present.

Inventors:
THELEN GREG (US)
Application Number:
PCT/US2011/039229
Publication Date:
December 13, 2012
Filing Date:
June 06, 2011
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
HEWLETT PACKARD DEVELOPMENT CO (US)
THELEN GREG (US)
International Classes:
G06F15/16; G06F21/20
Foreign References:
US20020019874A12002-02-14
US7313557B12007-12-25
US5175852A1992-12-29
JP2009211668A2009-09-17
US7360034B12008-04-15
Attorney, Agent or Firm:
ORTEGA, Arthur S. et al. (L.P.Intellectual Property Administration,Mail Stop 35 3404 E. Harmony Roa, Fort Collins Colorado, US)
Download PDF:
Claims:
What is claimed is:

1 . A computer system comprising:

a file system to be shared by a plurality of file servers according to respective different file server protocols, wherein the file system is to provide the plurality of file servers separate paths to file system objects of the file system, the file system to implement cross-protocol locking in access of the file system objects;

a machine-readable storage medium to store the file system objects;

an inode for a particular one of the file system objects, where the inode refers to a data structure containing information indicating that an access of the particular file system object has been made from a first of the file server protocols,

wherein the file system is to deny access of the particular file system object by a second file server according to a second different one of the file server protocols in response to the data structure indicating that an access of the particular file system object is present from the first file server protocol. 2. The computer system of claim 1 , wherein the data structure includes a counter indicating a number of accesses of the particular file system object from the first file server protocol. 3. The computer system of claim 1 , wherein the data structure includes first information indicating a number of read accesses of the particular file system object from the first file server protocol, and second information indicating a number of write accesses of the particular file system object from the first file server protocol. 4. The computer system of claim 3, wherein the data structure includes a first entry containing the first information and the second information, and wherein the data structure further includes a second entry containing third information indicating a number of read accesses of the particular file system object from the second file server protocol, and fourth information indicating a number of write accesses of the particular file system object from the second file server protocol.

5. The computer system of claim 4, wherein the file system is to allow access of the particular file system object by the second file server in response to the data structure indicating that no access of the particular file system object is present from the first file server protocol. 6. The computer system of claim 5, wherein upon allowing access of the particular file system object by the second file server, the file system is to update one of the third information and fourth information in the data structure. 7. The computer system of claim 4, wherein the file system is to allow write access of the particular file system object by the second file server in response to the data structure indicating that no read or write access of the particular file system object is present from the first file server protocol. 8. The computer system of claim 4, wherein the file system is to allow read access of the particular file system object by the second file server in response to the data structure indicating that no write access of the particular file system object is present from the first file server protocol. 9. The computer system of claim 1 , wherein the inode is a first inode, and the computer system further comprises:

a second inode for the particular file system object, where the second inode also refers to the data structure, wherein the first inode has a protocol field identifying the first file server protocol, and the second inode has a protocol field identifying the second file server protocol. 10. The computer system of claim 9, wherein the first and second inodes are virtual inodes, and wherein the file system further includes an actual inode for the particular file system object, where the first and second inodes shadow the actual inode.

1 1 . The computer system of claim 10, further comprising virtual elements that are part of a file system hierarchy, wherein the virtual elements include the first and second inodes, and shadow directory inodes to shadow a root directory of the file system hierarchy. 12. A method of at least one processor, comprising:

receiving, by a file system, a request from a first file server according to a first file server protocol, where the request is to access a particular file system object of the file system;

determining, by the file system as part of cross-protocol locking, whether the request is to be denied, wherein the determining comprises accessing an inode corresponding to the particular file system object and checking a data structure referred to by the inode to determine whether an access of the particular file system object is currently active from a second file server protocol that is different from the first file server protocol; and

denying the request in response to the data structure indicating an access of the particular file system object is currently active from the second file server protocol. 13. The method of claim 12, wherein checking the data structure comprises checking a protocol usage table having plural entries corresponding to different file server protocols including the first and second file server protocols, wherein each of the entries contains information identifying a number of read accesses and a number of write accesses from the respective file server protocol. 14. The method of claim 13, further comprising:

updating corresponding information in one of the entries of the protocol usage table in response to allowing access of the particular file system object, wherein the updating includes incrementing a count of the read accesses or a count of the write accesses from a given one of the file server protocols.

15. The method of claim 13, further comprising:

further updating corresponding information in one of the entries of the protocol usage table in response to closing an inode corresponding to the particular file system object, wherein the further updating includes decrementing a count of the read accesses or a count of the write accesses from a given one of the file server protocols 16. An article comprising at least one machine-readable storage medium storing instructions that upon execution cause a system to perform a method according to any of claims 12-15.

Description:
CROSS-PROTOCOL LOCKING WITH A FILE SYSTEM

Background

[0001 ] Computers can use file systems to store different types of objects. Typical objects include files and directories. Directories are hierarchical arrangements of objects, and may have nested objects. Directories include files or file folders and sub-directories. File systems use storage media to store objects, such as hard drives, flash media, or other non-volatile storage.

[0002] A file system also uses and stores metadata that describes information about the file system. Such metadata is typically hidden from users (which can include applications in a computer system). The metadata describes where on the physical storage media the files are located. The storage media may be considered as a large array of bytes. However, the file system does not appear to a user or to be an array of bytes, but rather includes a hierarchy of objects such as files and directories. The mapping between the bytes in the storage media and the hierarchy of the files is described in the metadata. In other words, the metadata provides a mapping between the physical storage of the data and how the data is presented to the user. More specifically, the metadata provides a description as to where each file or portion of a file is located on the storage media. Note that while a file or directory may appear contiguous to a user, the file as stored on the storage media may be located in many different areas.

Brief Description Of The Drawings

[0003] Some embodiments are described with respect to the following figures:

Figs. 1 A-1 B depict example arrangements that incorporate various

implementations;

Fig. 2 depicts an in-memory inode including a count data structure according to some implementations;

Fig. 3 illustrates an in-memory inode cache according to some

implementations;

Fig. 4 illustrates a protocol usage table according to some implementations;

Fig. 5 illustrates an in-memory directory entry according to some

implementations;

Fig. 6 illustrates an in-memory file handle according to some implementations; Fig. 7 illustrates a file system hierarchy according to some implementations; and

Figs. 8-15 are flow diagrams of various procedures of a file system, according to various implementations.

Detailed Description

[0004] Fig. 1 A illustrates an example arrangement that has a file system 102 according to some implementations. In examples according to Fig. 1 A, multiple file servers 106, 108, are depicted, where the file servers 106, 108 are able to access the file system 102 to perform various operations (e.g. read and write operations) on file system objects 1 10 of the file system 102. In the diagram of Fig. 1 A, two file servers are shown— in different examples, more than two file servers can be provided. Although just one file system is shown in Fig. 1A, note that there can be multiple file systems in other examples. [0005] A file server is a system that is accessible by clients for accessing shared storage. In this case, the shared storage is provided by the file system 102. The multiple file servers 106, 108 operate according to different file server protocols (referred to as "protocol A" and "protocol B" in Fig. 1 A). Example file server protocols include a CIFS (Common Internet File System) protocol, an NFS (Network File System) protocol, HTTP (Hypertext Transfer Protocol), or any other protocol.

[0006] Different file server protocols may employ different file locking semantics, where file locking semantics control locking of a particular data object that is being accessed such that the particular data object is not accessed by another requester. For example, while a first requester is performing a read access of the particular data object, the particular data object is locked such that a second requester would not be able to perform a write access of the particular data object.

[0007] As an example of a difference in locking semantics between different file server protocols, the CIFS protocol allows a client to prohibit other clients from opening a file using a "share mode." On the other hand, the NFS protocol has no concept of the share mode. Thus, if the CIFS file server is accessing a particular file using the share mode, and a later request comes from the NFS file server for the same file, typical systems may not be able to enforce the shared mode request made by the CIFS file server. This can result in corruption of data.

[0008] Enforcing locking semantics between different file server protocols can be complex. However, in accordance with some implementations, the file system 102 includes a cross-locking protocol mechanism 1 14 that provides a relatively efficient mechanism for ensuring that appropriate locking is provided in response to requests from different file server protocols for the same file system object. As used herein, a "request from a file server protocol" refers to a request submitted by the respective file server that operates according to the file server protocol. The file server may have submitted the request in response to a request from a client.

[0009] In accordance with some implementations, the file servers 106, 108 according to the different file server protocols are able to access the file system 102 over respective separate paths 107 and 109. The file system 102 is able to determine the requesting file server protocol based on the path used to access a file system object.

[0010] To implement cross-protocol locking, each file system object 1 10 is associated with multiple per-protocol inodes 120, 122, each one corresponding to a respective file server protocol. For multiple file system objects 1 10, there are multiple sets of the per-protocol inodes 120, 122.

[001 1 ] Note that the per-protocol inodes 120, 122 are virtual inodes that shadow an actual inode of the respective file system object (an inode stores information about a file system object, such as a file, directory, or other object). The inode 120 is associated with a first file server protocol, while the inode 122 is associated with a second file server protocol. The per-protocol inodes 120, 122 are in-memory inodes (which are stored in volatile storage rather than stored in persistent storage).

[0012] In accordance with some implementations, each per-protocol inode 120, 122 refers to a data structure 150 that has entries corresponding to respective ones of the different file server protocols (e.g. protocols A and B in Fig. 1 A). In some examples, this data structure 150 is referred to as a protocol usage table— in other examples, the data structure can have another format. Each entry of the protocol usage table indicates whether an access is currently being made from a respective file server protocol. In some implementations, each entry of the protocol usage table includes count information to count a number of read accesses from the respective file server protocol, and a number of write accesses from the respective file server protocol. Further details regarding the protocol usage table are provided below in connection with Fig. 4.

[0013] The multiple per-protocol inodes 120, 122 associated with a given file system object refer to the same protocol usage table 150, which as noted above has multiple entries corresponding to the different file server protocols. Another file system object would be associated with its corresponding distinct group of per- protocol inodes 120, 122 and protocol usage table 150. [0014] Using the protocol usage table 150 referred to in the per-protocol inodes 120, 122, the file system 102 is able to allow or deny a request from a file server protocol for access of a file system object.

[0015] Fig. 1 B illustrates another example arrangement that includes various components of Fig. 1 A, except further components are also shown. Fig. 1 B depicts a computer system 100 that includes an operating system 104 and the file system 102 according to some implementations. Examples of the computer system 100 include a server computer, a user computer (e.g., notebook computer, desktop computer, client computer, tablet computer), a storage system (e.g., a storage server, an archive server, a backup server, etc.), or any other type of electronic device.

[0016] The file system 102 can be considered to be part of the operating system 104, or alternatively, the file system 102 can be implemented separately from the operating system 104.

[0017] The file servers 106, 108 are able to access the computer system 100 over a data network 101 . In different examples, the file servers 106, 108 may be provided in the computer system 100. The computer system 100 can include a single computer node, or a distributed arrangement of multiple computer nodes.

[0018] The computer system 100 also includes one or multiple processors 130, a memory 132, and a persistent storage subsystem 134. The memory 132 can be volatile memory, such as a random access memory. The persistent storage subsystem 134 can be implemented with non-volatile storage device(s) such as disk- based storage device(s), integrated circuit storage device(s), and so forth.

[0019] The file system objects 1 10 can be stored in the persistent storage subsystem 1 12. The persistent storage subsystem 1 12 can also store persistent inodes (or "on-disk" inodes)— such persistent inodes are distinguished from in- memory inodes. Persistent inodes are not discussed further below.

[0020] In-memory inodes (including actual in-memory inodes and virtual inodes) are stored in the memory 132. Also, various virtual elements 140 that are part of the cross-protocol locking mechanism 1 14 can be stored in the memory 132. Such virtual elements 140 include the virtual inodes 120, 122 and protocol usage table 150 discussed above, as well as a shadow directory 142 (named "Protocols" in some examples). This shadow directory 142 is used to shadow the root directory of a file system hierarchy implemented by the file system 102. The virtual elements 140 can also include additional elements, which are discussed further in connection with Fig. 7 below. Other file system elements can also be stored in the memory 132

(discussed further below).

[0021 ] Fig. 2 illustrates an in-memory inode 200, which can be one of the virtual inodes 120, 122 or an actual inode of a file system object. The inode 200 has various fields, including an inode_number field (which is a number to identify the inode), and an inode_type field, which indicates that the type of the file system object is either a file or a directory. The inode 200 also includes an inode_sub_type field to indicate a particular sub-type of the file system object, which in some

implementations can be normal or a protocols_directory. A "normal" file system object refers to a normal file or directory. A file system object according to the protocols_directory sub-type is a shadow directory (which is discussed further below).

[0022] The inode 200 also includes a file system ID field, which contains an identifier of the file system. If there are multiple file systems, then each file system is identified by a respective unique file system ID. In addition, the inode 200 includes an inode_protocol_usage field that refers to a protocol usage table 150 (shown in Fig. 4, discussed further below).

[0023] In addition, the inode 200 includes an inode_reference_count field, which counts a number of accesses of a respective file system object from a corresponding file server protocol. The inode_reference_count field is incremented with each access (read or write access) of the respective file system object from the

corresponding file server protocol.

[0024] The inode 200 also includes an inode_protocol field that can be set to identify various file server protocols, such as CIFS, NFS, etc. Another possible value for the inode_protocol field is the "UNSET" value, which indicates that a file server protocol has not been set for the inode 200.

[0025] Fig. 3 illustrates an in-memory inode cache 300 (stored in the memory 122 of Fig. 1 B). The in-memory inode cache 300 contains information pertaining to inodes that are currently open (inodes that are associated with file system objects being accessed by respective file servers). In the example of Fig. 3, each entry of the inode cache 300 contains an inode number and the respective in-memory inode. Entry 302 contains inode_number_1 , which identifies in-memory inode_1 . Entry 304 contains inode_number_2, which identifies in-memory inode_2. An inode number is distinct for each file system object, and is an internal address that is used by the file system. The inode number may be translatable to an address of the persistent storage subsystem 134.

[0026] The in-memory inode cache 300 is searched, in response to a request to access the file system object, to determine if any inode corresponding to the given file system object is open. Each matched node can be discriminated by inode_type and/or inode_sub_type and/or file_system_id and/or inode_protocol(fields that are part of the inode 200 shown in Fig. 2).

[0027] Fig. 4 illustrates a protocol usage table 150, which has multiple entries 402, 404, one for each file server protocol. There are multiple protocol usage tables 150 associated with multiple respective file system objects. Each protocol usage table is referred to by a group of per-protocol inodes (e.g. 120, 122 in Fig. 1 A or 1 B). In the example of Fig. 4, two entries 402 and 404 for two respective different file server protocols (protocol_A and protocol_B) are depicted. The entry 402 contains a number of readers (num_A_readers) field and a number of writers (num_A_writers) field corresponding to protocol_A. Entry 404 corresponds to protocol_B, and contains a number of readers (num_B_readers) field and a number of writers (num_B_writers) field.

[0028] For each read access of the corresponding file system object from protocol_A, the num_A_readers field is incremented, and for each write access of the corresponding file system object from protocol_A, the num_A_writers field is incremented. Similarly, for each read access of the corresponding file system object from protocol_B, the num_B_readers field is incremented, and for each write access of the corresponding file system object from protocol_B, the num_B_writers field is incremented.

[0029] The protocol usage table 150 further includes a

protocol_table_reference_count field, which counts a number of virtual inodes (e.g. 120, 122) that refer to the protocol usage table 150.

[0030] Fig. 5 depicts an in-memory directory entry 500 that contains information pertaining to a directory (which is a collection of objects, such as files, subdirectories, and other objects, such as sockets). A directory is logically a collection of directory entries. Each directory entry 500 has the following two fields: link_name and inode_number.

[0031 ] Fig. 6 illustrates an in-memory file handle 600 that refers to an in-memory file object. The file handle 600 is created in response to a request to open a file object. The file handle 600 includes a file_inode field that refers to an in-memory inode (200 in Fig. 2). The file handle 600 also includes a file_access field, which indicates whether the access of the in-memory inode is a read access or a write access (or both read and write access).

[0032] An example file system hierarchy 700 according to some implementations is shown in Fig. 7. The file system hierarchy includes a root directory 701 , which is the top directory. The root directory 701 is itself stored as an inode (which in the example of Fig. 7 is identified by inode_number 2). Under the root directory 701 are other file system objects, which in the example of Fig. 7 includes a directory inode 702 (for directory dir_A) and a file inode 703 (for file file A). The directory inode 702 is identified by inode_number 3, while the file inode 703 is identified by

inode_number 4. Each of the inodes 702 and 703 have their respective

inode_protocol fields set to the "UNSET" value. Note that the inodes 702 and 703 are actual inodes for respective file system objects (dir_A and file_A, respectively), and thus the concept of file server protocol does not apply to these inodes. Rather, the inode_protocol fields for virtual inodes (such as per-protocol inodes 120, 122 in Fig. 1 A or 1 B) are set to identify respective file server protocols. Although just one directory and one file is shown in the file system hierarchy 700, it is noted that a typical file system hierarchy can have a relatively large number of directories and files. Moreover, a directory can have multiple levels of sub-file system objects (subdirectories and files) under the directory.

[0033] In accordance with some implementations, virtual elements (represented generally as 140) are part of the file system hierarchy 700. The virtual elements 140 include a shadow directory inode 704, which is assigned the special "Protocols" name. Note that the virtual directory inode 704 is also identified by inode_number 2, since it shadows the root directory 701 . The inode_type of the shadow directory inode 704 is "directory," while the inode_sub_type of the virtual directory inode 704 is "protocols_directory." The inode_protocol field of the shadow directory inode 704 is set to the "UNSET" value.

[0034] Under the shadow directory inode 704 are additional virtual inodes 706 and 707 for shadowing the root directory 701 for corresponding different file server protocols (e.g. CIFS, protocol_N). Each virtual root directory inode 706, 707 is also identified by inode_number 2 (the inode number of the root directory 701 ). In addition, the inode_protocol fields of the virtual root directory inodes 706, 707 are set to respective "CIFS" and "protocol_N" values to identify the respective different file server protocols.

[0035] Each virtual root directory inode 706, 707 points to further virtual inodes that shadow the actual inodes 702, 703. For example, the CIFS virtual root directory inode 706 points to a virtual inode 708 (having inode_number 3 and inode_protocol field set to "CIFS") that shadows the directory inode 702, and to a virtual inode 709 (having inode_number 4 and inode_protocol field set to "CIFS") that shadows the file inode 703. Similarly, the "protocol_N" virtual root directory inode 707 points to respective a virtual inode 710 (having inode_number 3 and inode_protocol field set to "protocol_N") that shadows the directory inode 702, and a virtual inode 71 1 (having inode_number 4 and inode_protocol field set to "CIFS") that shadows file inode 703. [0036] Fig. 8 is a flow diagram of a process, performed by the file system 102, of opening an inode along a particular path (one of paths 107, 109 depicted in Fig. 1 A or 1 B, for example), for a given access (read and/or write access). A path name in the access request is converted (at 802) to an in-memory inode (using a procedure according to Fig. 10, discussed further below). The file system 102 then searches (at 804) the in-memory cache 300 as well as data structures in the persistent storage subsystem 134 to determine whether the corresponding inode is present in the file system 102. If not, a "not found" error is returned (at 806).

[0037] However, if the inode is found, then the file system 102 determines (at 808) if the in-memory inode_protocol field of the corresponding inode allows for opening using the desired access (read and/or write). This determination is based on a procedure according to Fig. 9, discussed further below. If the determination at 808 indicates that access is to be denied (such as when a write access is attempted on an inode that is already open for another access, either read or write), then the file system returns (at 810) an "access denied" error.

[0038] On the other hand, if the determination at 808 indicates that access is allowed, then the appropriate entry of the protocol usage table 150 (Fig. 4) is updated (at 812). The appropriate entry of the protocol usage table 150 is identified (where the identified entry corresponds to the protocol of the current read and/or write access), and the respective number of readers or number of writers field is incremented based on the requested access. In other words, if the present access is a read access, then the number of readers field is incremented, whereas if the present access is a write access, then the number of writers field is incremented.

[0039] Next, the file system creates (at 814) a new file handle (e.g. file handle 600 shown in Fig. 6) that references the discovered inode. The file_access entry of the file handle 600 is set to the requested access (read access or write access or both). The newly created file handle is returned (at 816), where the newly created file handle is stored in some data structure (such as an index table) to allow for later access. [0040] Fig. 9 illustrates a procedure of the file system 102 to determine if a given inode can be opened. The procedure of Fig. 9 is invoked from task 808 in Fig. 8, discussed above.

[0041 ] Given the in-memory inode and the desired access (read and/or write), the procedure of Fig. 9 determines (at 902) if the requested access is a write access. If so, then the procedure scans (at 904) the protocol usage table 150 (identified by the inode's inode_protocol_usage field of the inode) for any reader or writer for a protocol that is different than the inode_protocol of the given inode (that is to be opened). For example, if a current access request is from file server protocol_A, then the file system checks the entry (or entries) for other protocols (e.g. entry 404 in table 150 shown in Fig. 4) to determine if there is any read or write access from file server protocol protocol_B (either num_B_readers is non-zero or num_B_writers is non-zero).

[0042] If any read or write accesses from a different protocol (different from the protocol of the present access request), then the procedure returns (at 906) an "access denied" response. On the other hand, if the associated protocol usage table indicates that no read or write access from a different protocol is currently active, then the procedure returns (at 908) an "access allowed" response.

[0043] If the procedure of Fig. 9 determines (at 902) that the requested access is not a write access (it is a read access), then the procedure scans (at 910) the protocol usage table 150 for any write access from a different file server protocol (different from the file server protocol of the requested access). If a write access from a different file server protocol is found (i.e. the number of writers field of the entry of the protocol usage table 150 corresponding to the different file server protocol is non-zero), then the procedure returns (at 906) an "access denied" response. On the other hand, if a write access from a different file server protocol is not found, then the procedure returns (at 908) an "access allowed" response.

[0044] Fig. 10 is a procedure of the file system 102 to convert a path name (e.g. /home/bob/project.txt) to an inode (invoked at 802 in Fig. 8). First, the procedure determines (at 1002) if the path name is absolute (in other words, if the path name begins with 7". If so, then the root directory inode is used as the current inode (at 1004). The procedure determines (at 1006) if the path name is equal 7". If so, then the current inode is returned (at 1008). On the other hand, if the path name is not equal 7", then the procedure sets (at 1010) the current link_name from the first path component found in the path.

[0045] If the determination at 1002 indicates that the path is not absolute, then the current working directory inode is used (at 1005) as the current inode.

[0046] The procedure then recursively performs tasks 1012, 1015, and 1018 to go through the different components of the path to find respective inodes, until the end of the path is reached and the in-memory inode corresponding to the last component of the path is found (in the example path name /home/bob/project.txt given above, the in-memory inode for the file "project.txt" is returned).

[0047] An in-memory inode corresponding to the current link_name is looked up (at 1012), using a procedure according to Fig. 1 1 . The current inode found by the procedure of Fig. 1 1 is used as the current inode. If no inode is found at 1012, then a "not-found" error is returned (at 1014).

[0048] On the other hand, if an inode is found by the procedure of Fig. 1 1 , the current link_name is then set (at 1015) to the next path component. If there are no more path components, then the current inode is returned (at 1008). On the other hand, if there is a next path component, it is determined (at 1018) whether the current inode has an inode_type field that is equal to "directory." If not, then a "not-a- directory" error is returned (at 1020). However, if the inode_type field of the current inode is equal "directory" then the procedure returns to task 1012, where the process repeats.

[0049] The procedure of Fig. 1 1 determines (at 1 102) whether the inode's inode_sub_type field indicates "protocols_directory." If not, the procedure next determines (at 1 104) whether the link_name is equal to the special "Protocols" name (for the shadow directory inode 704 in Fig. 7). If so, the procedure determines (at 1 106) whether the directory's inode_protocol field has an "UNSET" value. If so, then a procedure of Fig. 12 is used (at 1 108) to obtain the in-memory inode from the inode cache 300 (Fig. 3) using the following information: file system ID,

inode_number, inode_type = "directory" inode_sub_type = protocols_directory and inode_protocol = "UNSET."

[0050] If the procedure determines (at 1 106) that the directory's inode_protocol field is not "UNSET," then a "not-found" message is returned (at 1 1 10).

[0051 ] If the determination at 1 104 indicates that the link_name is not equal to the special "Protocols" name, which indicates that the directory is a normal directory, then it is determined (at 1 1 12) whether the specified link_name addresses an inode within the directory. If not, then a "not-found" message is returned (at 1 1 10).

However, if the specified link_name addresses an inode within the directory, the procedure uses (at 1 1 14) the procedure of Fig. 12 to obtain the in-memory inode from the inode cache 300 using the inode_number from the corresponding directory entry. Additionally, the procedure sets the inode_type field from the corresponding inode, and sets the inode_sub_type field to "normal."

[0052] If the determination at 1 102 indicates that the directory's inode_sub_type field contains "protocols_directory," then the procedure of Fig. 1 1 determines (at 1 1 16) if the specified link_name addresses a registered protocol name. If not, then a "not-found" message is returned (at 1 1 10).

[0053] However, if the specified link_name addresses a registered protocol name, then the procedure of Fig. 12 is used (at 1 1 18) to obtain the in-memory inode from the inode cache 300 using the following information: file system ID and inode_number. Also, from the corresponding directory inode, the following fields are set as follows: inode_type = "directory"; inode_sub_type = normal; and

inode_protocol = link_name.

[0054] The procedure of Fig. 12 obtains an in-memory inode from the inode cache 300, based on the following input information: file system ID, inode_number, inode_type, inode_sub_type, inode_protocol. Such information is used (at 1202) to search the in-memory inode cache 300. If matching inode(s) is (are) found (as determined at 1204), then the inode_reference_count field in the respective in- memory inode is incremented (at 1206). The inode is then returned (at 1208).

[0055] However, if no matching inode is found in the inode cache 300, a new in- memory inode is allocated (at 1210). The new in-memory inode is initialized (at 1212) with the input i nod e_n umber, inode_type, inode_sub_type, and

inode_protocol. The file system ID and inode_number are used to search (at 1214) the in-memory inode cache 300 for any inode referring to a corresponding protocol usage table 150. Note that multiple per-protocol inodes for a given file system object refer to a common protocol usage table 150.

[0056] If such protocol usage table 150 is found (as determined at 1214), then the protocol_table_reference_count in the protocol usage table 150 is incremented (at 1216). The newly allocated inode's inode_protocol_usage field is set to reference the identified inode protocol usage table 150.

[0057] If the specified protocol usage table is not found (as determined at 1214), then a new, empty protocol usage table 150 is allocated (at 1218), with the protocol_table_reference_count in the new protocol usage table 150 set to 1 . The inode_protocol_usage field of the newly allocated inode is set to refer to the newly allocated protocol usage table 150.

[0058] The newly allocated inode is then inserted (at 1220) into the inode cache 300.

[0059] Fig. 13 illustrates a procedure of the file system 102 to close an inode that was previously opened, such as opened using the procedure of Fig. 8. Given an in- memory file object (which is a wrapper around a respective inode), the protocol usage table 150 is scanned (at 1302) for an entry identified by the inode_protocol field of the inode. This identified entry is recorded. Next, the procedure determines (at 1304) whether the file access associated with opening the inode is a write access. If not, then the number of readers field in the identified row of the inode protocol usage table 150 is decremented (at 1306). However, if the file access was a write, then the number of writers field in the identified entry of the protocol usage table 150 is decremented (at 1308). The procedure of Fig. 14 is then invoked (at 1310) to dereference an inode.

[0060] Effectively, according to the procedure of Fig. 13, when an inode corresponding to a particular file server protocol is closed, the corresponding number of readers or number of writers field in the protocol usage table 150 is decremented.

[0061 ] Fig. 14 shows a procedure of the file system 102 to dereference an inode (as invoked at task 1310 in Fig. 13). The inode_reference_count of the inode to be dereferenced is decremented (at 1402). If the inode_reference_count is zero (as determined at 1404), then the procedure of Fig. 14 removes (at 1406) the inode from the in-memory inode cache 300. On the other hand, if the inode_reference_count is not zero, then the procedure completes. The inode_reference_count being equal to zero means that there are no further pending accesses of the respective inode, such that the inode can be removed from the inode cache 300.

[0062] After task 1406, the procedure decrements (at 1407)

protocol_reference_count in the protocol usage table 400 (Fig. 4). Next, the procedure determines (at 1408) whether protocol_reference_count is zero; if so, the protocol usage table 400 is deleted (at 1409).

[0063] Fig. 15 is a flow diagram of a procedure of the file system 102 of enumerating a directory, such as the root directory of the file system hierarchy 700 shown in Fig. 7. Given an open file handle to a directory inode (the inode

corresponding to the root directory, for example), the procedure of Fig. 15

determines (at 1502) whether the directory inode's inode_sub_type field is equal to " protocol s_di rectory." If so, then for each registered protocol name (e.g. protocol_A, protocol_B, etc.) determined at 1504, the directory entry is published (at 1506) with the link_name set to current protocol name and inode_number is set to the

starting_directory_inode_number. Basically, at 1506, elements 706 and 707 in the example hierarchy 700 of Fig. 7 are published. [0064] Once there are no more registered protocol names (as determined at 1504), then the procedure of Fig. 15 completes (at 1508), since there are no more directory entries to publish.

[0065] If the determination (at 1502) indicates that the directory inode's inode_sub_type is not equal to "protocols_directory," then the procedure determines (at 1510) if the directory inode's inode_protocol has value "UNSET." If so, then the procedure proceeds to task 1512, where the directory entry for the shadow directory is published using the special link_name ("Protocols"), and the inode_number is set equal to a starting_directory_inode number. The procedure then proceeds to task 1514.

[0066] If, on the other hand, the directory inode's inode_protocol field is not set to "UNSET," then the procedure proceeds to task 1514, where the first directory entry is identified within the given directory inode. This allows a real file system object to be published.

[0067] The procedure next determines (at 1516) whether the directory entry was found. If not, then the procedure ends (1508). However, if the directory entry was found, then the directory entry is published (at 1518) using the link_name and inode_number from the identified directory entry. The procedure next finds (at 1520) the next directory entry within the given directory inode. The process of 1516, 1518, and 1520 are iteratively performed to publish 702, 703, 708, 709, 710, and 71 1 in the example hierarchy of Fig. 7.

[0068] Using techniques or mechanisms according to some implementations, cross-protocol locking can be implemented relatively efficiently.

[0069] Machine-readable instructions of modules described above (including the file system 102 of Fig. 1A or 1 B) are executed on a processor or multiple processors (such as 130 in Fig. 1 B). A processor can include a microprocessor, microcontroller, processor module or subsystem, programmable integrated circuit, programmable gate array, or another control or computing device. [0070] Data and instructions are stored in respective storage devices, which are implemented as one or more computer-readable or machine-readable storage media. The storage media include different forms of memory including

semiconductor memory devices such as dynamic or static random access memories (DRAMs or SRAMs), erasable and programmable read-only memories (EPROMs), electrically erasable and programmable read-only memories (EEPROMs) and flash memories; magnetic disks such as fixed, floppy and removable disks; other magnetic media including tape; optical media such as compact disks (CDs) or digital video disks (DVDs); or other types of storage devices. Note that the instructions discussed above can be provided on one computer-readable or machine-readable storage medium, or alternatively, can be provided on multiple computer-readable or machine-readable storage media distributed in a large system having possibly plural nodes. Such computer-readable or machine-readable storage medium or media is (are) considered to be part of an article (or article of manufacture). An article or article of manufacture can refer to any manufactured single component or multiple components. The storage medium or media can be located either in the machine running the machine-readable instructions, or located at a remote site from which machine-readable instructions can be downloaded over a network for execution.

[0071 ] In the foregoing description, numerous details are set forth to provide an understanding of the subject disclosed herein. However, implementations may be practiced without some or all of these details. Other implementations may include modifications and variations from the details discussed above. It is intended that the appended claims cover such modifications and variations.