File Services
234
Titan SiliconServer
Titan supports three categories of oplocks:
•
Exclusive
An Exclusive oplock enables a single client to cache a file for both read and write
purposes. As the client that owns the oplock is the only client accessing the file, it can
read and modify part or all of the file locally. The client does not need to post any
changes to the server until it closes the file and releases the oplock.
•
Batch
A Batch oplock enables a single client to cache a file for both read and write purposes, as
in the case of an exclusive oplock. In addition, the client can preserve the cached
information even after closing the file; file open and close operations are also performed
locally. The client does not need to post any changes back to the server until it releases
the oplock.
•
Level II
A Level II oplock enables multiple clients to cache a file for read purposes only. The
clients owning the oplock can read file data and attributes from local information,
cached or read-ahead. If one client makes any changes to the file, all the oplocks are
broken.
When dealing with oplocks, Titan acts in accordance with the CIFS specification. Whether
operating in a pure Windows environment or with a mix of CIFS and NFS clients, Titan allows
applications to take advantage of local caches while preserving data integrity.
Exclusive and Batch Oplocks
An Exclusive or Batch oplock is an exclusive (read-write/deny-all) file lock that a CIFS client
may obtain at the time it opens a file. The server grants the oplock only if no other application is
currently accessing the file.
When a client owns an Exclusive or Batch oplock on a file, it can cache part or all of the file
locally. Any changes that the client makes to the file are also cached locally. Changes do not
need to be written to the server until the client must release the oplock. In the case of an
Exclusive oplock, the client releases the oplock when the server requests that it does so, or
when it closes the file. In the case of a Batch oplock, the client may keep information (including
changes) locally even after closing the file. While the client has an Exclusive or Batch oplock on
a file, the server guarantees that no other client may access the file.
If a client requests access to a file that has an Exclusive or Batch oplock, the server asks the
client that has the oplock to release it. The client then writes the changes to the server and
releases the oplock. Once this operation has finished, the server allows the second client to
access the file. This happens regardless of the network protocol that the second client uses.
In cases where a CIFS client requests an oplock on a file that has an Exclusive or Batch oplock,
the server breaks the existing oplock and grants both clients Level II oplocks instead.