Patent ID: 8321389

Claim:
In a distributed file system in which a server system stores a server version of a file system directory, a method for synchronizing a client system with the server version of the file system directory, comprising: storing a cached client version of the file system directory, the client version reflecting updates to the server version of the file system directory that have been replicated on the client system, wherein the cached client version of the file system directory maintains an updaters count of pending requests from the client system to the server system to update the file system directory; incrementing the updaters count upon initiating an update request to the server system; decrementing the updaters count upon processing a reply to the update request from the server system; maintaining for the file system directory a change log queue containing change logs that have not been applied to the cached client version, each of the change logs in the change log queue specifying one or more updates to the file system directory and specifying an update version; receiving from the server system a reply to an update request, the reply containing a change log specifying one or more updates to the file system directory and specifying an update version; comparing the update version specified by the received change log with a stored last applied version specifying a last update version applied to the cached client version of the file system directory; when the update version specified by the received change log corresponds to a next expected version after the last applied version, applying the updates specified by the change log to the cached client version of the file system directory and incrementing the last applied version; and when the update version specified by the received change log corresponds to a later version than the next expected version, adding the received change log to the change log queue without incrementing the last applied version; wherein the cached client version of the file system directory maintains a read waiters flag indicating that one or more tasks are waiting to read the file system directory, the method further comprising: after decrementing the updaters count, determining from the decremented updaters count and the read waiters flag whether the updaters count has been decremented to zero and one or more tasks are waiting to read the file system directory; and when the updaters count has been decremented to zero and one or more tasks are waiting to read the file system directory, resetting the read waiters flag and waking up all such waiting tasks.