Patent ID: 7925796

Claim:
A method for performing an input/output (I/O) operation that includes a virtual drain, the method comprising: (a) receiving a request to perform an I/O operation involving the copying of data from a source storage entity to a destination storage entity; and (b) in response to receiving the I/O request: (i) arresting write requests to the source storage entity by preventing write requests from being placed into a write queue for storing write requests to the source storage entity; (ii) performing a virtual drain, wherein performing a virtual drain includes identifying, and indicating as deferred, pending writes to the source storage entity, wherein a pending write comprises a write request that exists in the write queue and has not yet been processed and wherein a deferred write comprises a write request which is processed after performing the I/O operation and which is processed in the context in which the deferred write was accepted; (iii) performing the I/O operation, and after performing the I/O operation: (a) releasing write requests to the source storage entity by allowing write requests to be placed into the write queue; and (b) processing each deferred write request using context information that is associated with the deferred write request and that describes the context in which the deferred write request was accepted, wherein the context information comprises at least one of a status of the source storage entity at the time that the deferred write request was accepted and a configuration of the source storage entity at the time that the deferred write request was accepted.