共用方式為


3.3.1.3 Algorithm for Change Notifications in an Object Store

The server MUST implement an algorithm that monitors for changes on an object store. The effect of this algorithm MUST be identical to that used to offer the behavior specified in [MS-CIFS] sections 3.2.4.39 and 3.3.5.59.4. The algorithm MUST meet the following conditions:

  • The algorithm MUST perform the change notification processing based on the CompletionFilter and SMB2_WATCH_TREE flag in the Flags field of the first CHANGE_NOTIFY request on an Open.LocalOpen. The algorithm MUST ignore the CompletionFilter and SMB2_WATCH_TREE flag in all further requests on the same open.

  • If the client sets the SMB2_WATCH_TREE flag in the Flags field of the first request on an Open.LocalOpen, indicating that an entire tree is being watched, the algorithm MUST monitor all objects beneath the directory on which the operation was issued, instead of simply the immediate children objects of that directory.

  • If a client issues multiple change notification requests on the same open to a directory, the server MUST queue the requests and complete them on a First In, First Out (FIFO) basis when changes are indicated by the underlying object store.

  • If a change notification request is pending on a directory and a change occurs to the directory contents matching the events to be monitored as specified by the CompletionFilter, the server MUST copy the results into the Buffer field of the CHANGE_NOTIFY response. The server SHOULD send the maximum number of events that match the CompletionFilter of the first CHANGE_NOTIFY request indicated by the underlying object store into a single response up to the maximum of the OutputBufferLength field. The server MUST construct the response in the format specified in section 2.2.36 and the change notification information in the format specified in [MS-FSCC] section 2.7.1. The server MUST then return the results to the client.