188.8.131.52 Server Application Requests Closing an Open
The calling application provides GlobalFileId as input parameter. The server MUST look up Open in GlobalOpenTable where Open.FileGlobalId is equal to GlobalFileId, and, if the Open is found, the server MUST perform the following:
Remove the Open from the GlobalOpenTable.
If Open.Connection is not NULL, cancel all requests in Open.Connection.RequestList for which Request.Open matches the Open, as specified in section 184.108.40.206.
Close the underlying Open.LocalOpen.
If Open.Session is not NULL, remove the Open from Open.Session.OpenTable.
If Open.TreeConnect is not NULL, decrease Open.TreeConnect.OpenCount by 1.
If Open.Connection.Dialect is not "2.0.2", the server supports leasing, and Open.Lease is not NULL:
The server MUST identify a LeaseTable by enumerating each entry in GlobalLeaseTableList to find the one whose LeaseTable.LeaseList contains Open.Lease.
The server MUST then remove the Open from Lease.LeaseOpens.
If Lease.LeaseOpens is now empty:
If Lease.Breaking is TRUE, the server MUST complete the lease break to the underlying object store with NONE as the new lease state. <201>
The server MUST remove the Lease from the LeaseTable.LeaseList and free the Lease.
If LeaseTable.LeaseList is now empty, the server MAY remove the LeaseTable from the GlobalLeaseTableList and free the LeaseTable.
The Open object is then freed.
Return STATUS_SUCCESS to the calling application.
If no Open is found, the call MUST return an implementation-dependent error.