Patent ID: 8484258

Claim:
A method for avoiding directory conflicts across a file system having multiple nodes, comprising: assigning, for each directory in a file system having multiple directories and multiple nodes each accessing each of the multiple directories in parallel and at least one node of said multiple nodes representing a token manager node, at least one node of said multiple nodes to act as a metanode responsible for collecting updates to a particular directory of said multiple directories and for writing updates to directory blocks of said particular directory on disk; obtaining, by a particular node of said multiple nodes, a name-based lock on a filename within said particular directory that is the target of an operation by said particular node, wherein other nodes of said multiple nodes concurrently perform operations on other files within said particular directory, wherein said name-based lock is represented by a byte-range lock for a range of selected bytes of said particular directory determined from a computed hash value of said filename within a total range of bytes for said particular directory; querying, by said particular node, said token manager for a name-based lock token for said range of selected bytes acquired under said name-based lock; if a new name-based lock token is obtained from said token manager, sending a Remote Procedure Call (RPC) to said metanode to obtain matching directory entries for at least one directory block matching said computed hash value of said filename from among said directory blocks of said particular directory; caching, by said particular node, said result of said RPC by inserting at least one directory entry for said at least one directory block received from said metanode in said result of said RPC into a cached directo block of said particular node and removing at least one other entry from said cached directory block not contained in said result of said RPC so that subsequent operations on said filename can be satisfied using said cached directory block without additional messages sent to said metanode, wherein said cached directory block is valid while said particular node holds said name-based lock token for said filename; and updating, by said particular node for said operation, said cached directory block in memory by either creating a new directory entry in said cached directory block for a create operation or deleting an existing directory entry from said cached directory block for a delete operation.